|
|
@ -86,15 +86,19 @@ namespace Tiobon.Core.Services |
|
|
|
public override async Task<ServicePageResult<Ghre_CourseWareDto>> QueryFilterPage(QueryBody body) |
|
|
|
public override async Task<ServicePageResult<Ghre_CourseWareDto>> QueryFilterPage(QueryBody body) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var result = await base.QueryFilterPage(body); |
|
|
|
var result = await base.QueryFilterPage(body); |
|
|
|
result.result.DT_TableDataT1.ForEach(async x => |
|
|
|
var data = result.result.DT_TableDataT1; |
|
|
|
|
|
|
|
var attachmentIds = data.Select(x => x.Id).ToList(); |
|
|
|
|
|
|
|
var attachments = await _ghre_CourseWareAttachmentServices.Query(x => x.CourseWareId != null && attachmentIds.Contains(x.CourseWareId.Value)); |
|
|
|
|
|
|
|
data.ForEach(async x => |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(x.CourseIds)) |
|
|
|
if (!string.IsNullOrWhiteSpace(x.CourseIds)) |
|
|
|
x.CourseIds2 = JsonConvert.DeserializeObject<List<long>>(x.CourseIds); |
|
|
|
x.CourseIds2 = JsonConvert.DeserializeObject<List<long>>(x.CourseIds); |
|
|
|
|
|
|
|
|
|
|
|
x.StudyDuration = $"{x.Hours}小时{x.Minutes}分钟"; |
|
|
|
x.StudyDuration = $"{x.Hours}小时{x.Minutes}分钟"; |
|
|
|
x.SourceLabel = await GetParaLabel("CourseWareSource", x.Source); |
|
|
|
x.SourceLabel = await GetParaLabel("CourseWareSource", x.Source); |
|
|
|
|
|
|
|
x.Attachments = attachments.Where(a=> a.CourseWareId == x.Id).ToList(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
result.result.DT_TableDataT1 = data; |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|