Commit 37235d67 authored by 黄奎's avatar 黄奎

页面修改

parent 0b47df82
......@@ -207,51 +207,66 @@ namespace EduSpider.WebApi.Controllers
CourseName = base.ReqParameters.GetString("CourseName"),
};
var courseRuleList = CourseService.GetCourseCommentList(query).OrderBy(qitem=>qitem.Times).ToList();
var sysCommentList = CourseService.GetSysComment(new CourseQuery() { KeyWords = query.CourseName, CommentTimes = query.CommentTimes }).OrderBy(qitem => qitem.Times).ToList();
List<object> result = new();
if (courseRuleList != null && courseRuleList.Count > 0)
for (var i = 1; i <= 3; i++)
{
foreach (var item in courseRuleList)
var tempCourseRule = courseRuleList.Where(qitem => qitem.Times == i).FirstOrDefault();
var defaultRule = sysCommentList.Where(qitem => qitem.Times == i).FirstOrDefault();
int IsDefault = 0;
int Id = 0;
List<object> SubList = new List<object>();
if (tempCourseRule != null)
{
result.Add(new
Id = tempCourseRule.Id;
if (tempCourseRule.CommentDetails != null && tempCourseRule.CommentDetails.Count > 0)
{
IsDefault = 0,
item.Id,
item.Times,
CommentDetails = item.CommentDetails.Select(qitem => new
foreach (var subItem in tempCourseRule.CommentDetails)
{
qitem.DetailId,
qitem.CourseCommentId,
qitem.StartNum,
qitem.EndNum,
qitem.Info,
}),
});
SubList.Add(new
{
subItem.DetailId,
subItem.CourseCommentId,
subItem.StartNum,
subItem.EndNum,
subItem.Info,
});
}
}
}
}
else
{
var sysCommentList = CourseService.GetSysComment(new CourseQuery() { KeyWords = query.CourseName, CommentTimes = query.CommentTimes }).OrderBy(qitem=>qitem.Times).ToList();
if (sysCommentList != null && sysCommentList.Count > 0)
else if (defaultRule != null)
{
foreach (var item in sysCommentList)
Id = defaultRule.Id;
IsDefault = 1;
if (defaultRule.Details != null && defaultRule.Details.Count > 0)
{
result.Add(new
foreach (var subItem in defaultRule.Details)
{
IsDefault = 1,
item.Id,
item.Times,
CommentDetails = item.Details.Select(qitem => new
SubList.Add(new
{
DetailId = 0,
CourseCommentId = 0,
qitem.StartNum,
qitem.EndNum,
qitem.Info,
}),
});
subItem.StartNum,
subItem.EndNum,
subItem.Info,
});
}
}
}
if (Id > 0)
{
result.Add(new
{
IsDefault,
Id,
Times = i,
CommentDetails = SubList
});
}
}
return ApiResult.Success(data: result);
}
......
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