Commit b73438b3 authored by 吴春's avatar 吴春

1

parent 6e8e1554
......@@ -3784,7 +3784,6 @@ namespace Edu.Module.Course
}
Rlist.Add(new
{
CourseRateName = (courseModel?.CourseId ?? 0) > 0 ? courseModel?.CourseRate.ToName() : "",
StudyID = studentStudyModel?.ID ?? 0,
Words = ((studentStudyModel?.Words ?? 0) > 0) ? studentStudyModel?.Words.ToString("F2") : "",
Practice = ((studentStudyModel?.Practice ?? 0) > 0) ? studentStudyModel?.Practice.ToString("F2") : "",
......@@ -3809,13 +3808,11 @@ namespace Edu.Module.Course
//跟班
cList.ForEach(x => { x.SortNum = Convert.ToDouble(x.ChapterNo); });
cList.OrderBy(x => x.SortNum).ToList().ForEach(x =>
{
var studentStudyModel = studyList?.FirstOrDefault(z => z.ChapterId == x.ChapterId && z.StudyType == 1);
Rlist.Add(new
{
CourseRateName = (courseModel?.CourseId ?? 0) > 0 ? courseModel?.CourseRate.ToName() : "",
StudyID = studentStudyModel?.ID ?? 0,
Words = ((studentStudyModel?.Words ?? 0) > 0) ? studentStudyModel?.Words.ToString("F2") : "",
Practice = ((studentStudyModel?.Practice ?? 0) > 0) ? studentStudyModel?.Practice.ToString("F2") : "",
......
......@@ -303,15 +303,24 @@ ORDER BY r.Id desc ";
{
where += $@" and sa.{nameof(RB_Scroll_Appointment_ViewModel.StuId)} in({demodel.StuIds})";
}
string sql = $@"
SELECT A.*,cc.ChapterName
string sql = $@" SELECT A.*,cc.ChapterName
FROM
(
SELECT StuId,LearnCourseId,MAX(CourseGradeNo) AS CourseGradeNo
SELECT sat.StuId,sat.LearnCourseId,sat.CourseGradeNo from RB_Scroll_Appointment as sat INNER JOIN (SELECT StuId,MAX(Date) as Date
FROM RB_Scroll_Appointment AS sa
WHERE 1=1 {where}
GROUP BY StuId,LearnCourseId
GROUP BY StuId) as t on t.Date=sat.Date and t.StuId=sat.StuId
) AS A LEFT JOIN rb_course_chapter as cc ON A.LearnCourseId=cc.CourseId and CONCAT(A.CourseGradeNo,'')=cc.ChapterNo ";
// string sql = $@"
//SELECT A.*,cc.ChapterName
//FROM
//(
//SELECT StuId,LearnCourseId,MAX(CourseGradeNo) AS CourseGradeNo
//FROM RB_Scroll_Appointment AS sa
//WHERE 1=1 {where}
//GROUP BY StuId,LearnCourseId
//) AS A LEFT JOIN rb_course_chapter as cc ON A.LearnCourseId=cc.CourseId and CONCAT(A.CourseGradeNo,'')=cc.ChapterNo ";
return Get<RB_Scroll_Appointment_ViewModel>(sql, parameters).ToList();
}
......
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