Commit a0e09b0d authored by 吴春's avatar 吴春

提交代码

parent e5fddb4b
......@@ -1871,11 +1871,23 @@ namespace Mall.WebApi.Controllers.Education
List<object> fileGroup = new List<object>();
foreach (var item in group.GroupBy(x => x.Type))
{
fileGroup.Add(new
List<object> fileObjectList = new List<object>();
foreach (var itemGroup in fileList.Where(x=>x.Type==item.Key).GroupBy(x => x.GroupId))
{
fileObjectList.Add(new
{
Name = group.Where(x => x.Id == itemGroup.Key).FirstOrDefault()?.Name ?? "默认",
Id = itemGroup.Key,
Type = item.Key,
FileList= fileList.Where(x=>x.GroupId==itemGroup.Key&&x.Type==item.Key).ToList()
});
}
fileGroup.Add(new
{
item.Key,
groupList = group.Where(x => x.Type == item.Key).ToList()
// groupList = group.Where(x => x.Type == item.Key).ToList(),
groupList= fileObjectList
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment