Commit 0b61890a authored by liudong1993's avatar liudong1993

1

parent ab3d4a2d
...@@ -3371,8 +3371,9 @@ namespace Edu.Module.Course ...@@ -3371,8 +3371,9 @@ namespace Edu.Module.Course
var cList = course_ChapterRepository.GetChapterListRepository(new RB_Course_Chapter_ViewModel() { Group_Id = demodel.Group_Id, CourseId = item.CourseId }); var cList = course_ChapterRepository.GetChapterListRepository(new RB_Course_Chapter_ViewModel() { Group_Id = demodel.Group_Id, CourseId = item.CourseId });
if (item.ClassScrollType == 2) if (item.ClassScrollType == 2)
{ {
var achildList = AppointList.Where(x => x.GuestId == ogModel.GuestId).ToList();//当前课程的
//预约课 //预约课
int CourseChapterNo = AppointList.Any() ? AppointList.Max(x => x.ChapterNo) : 0; int CourseChapterNo = achildList.Any() ? achildList.Max(x => x.ChapterNo) : 0;
int CourseChapterNo2 = SkipList.Any()? SkipList.Max(x => x.ChapterNo) : 0; int CourseChapterNo2 = SkipList.Any()? SkipList.Max(x => x.ChapterNo) : 0;
CourseChapterNo = CourseChapterNo < CourseChapterNo2 ? CourseChapterNo2 : CourseChapterNo; CourseChapterNo = CourseChapterNo < CourseChapterNo2 ? CourseChapterNo2 : CourseChapterNo;
cList.ForEach(x => cList.ForEach(x =>
...@@ -3381,15 +3382,17 @@ namespace Edu.Module.Course ...@@ -3381,15 +3382,17 @@ namespace Edu.Module.Course
}); });
cList.Where(x => x.SortNum <= CourseChapterNo).OrderByDescending(x => x.SortNum).ToList().ForEach(x => cList.Where(x => x.SortNum <= CourseChapterNo).OrderByDescending(x => x.SortNum).ToList().ForEach(x =>
{ {
var AppointModel = AppointList.Where(y => y.ChapterNo == x.SortNum && y.AppointType != 3 && y.LearnCourseId == item.CourseId).FirstOrDefault(); var AppointModel = achildList.Where(y => y.ChapterNo == x.SortNum && y.AppointType != 3 && y.LearnCourseId == item.CourseId).FirstOrDefault();
var SkipModel = SkipList.Where(y => y.ChapterNo == x.SortNum && y.CourseId == item.CourseId).FirstOrDefault(); var SkipModel = SkipList.Where(y => y.ChapterNo == x.SortNum && y.CourseId == item.CourseId).FirstOrDefault();
int AgainNum = AppointList.Where(y => y.ChapterNo == x.SortNum && y.AppointType == 3 && y.LearnCourseId == item.CourseId).Count(); int AgainNum = achildList.Where(y => y.ChapterNo == x.SortNum && y.AppointType == 3 && y.LearnCourseId == item.CourseId).Count();
int State = 3; int State = 3;
int AppointState = 0; int AppointState = 0;
string ClassDate = "";
if (AppointModel != null) if (AppointModel != null)
{ {
//正常约课 ClassDate = AppointModel.Date.ToString("yyyy-MM-dd HH:mm");
if (AppointModel.AppointType == 1) //正常约课
if (AppointModel.AppointType == 1)
{ {
State = 1;//正常上课 State = 1;//正常上课
} }
...@@ -3412,7 +3415,8 @@ namespace Edu.Module.Course ...@@ -3412,7 +3415,8 @@ namespace Edu.Module.Course
x.ChapterGradeNo, x.ChapterGradeNo,
State, State,
AppointState, AppointState,
AgainNum AgainNum,
ClassDate
}); });
}); });
} }
...@@ -3420,7 +3424,7 @@ namespace Edu.Module.Course ...@@ -3420,7 +3424,7 @@ namespace Edu.Module.Course
//跟班 //跟班
int CourseChapterNo = oguestModel?.CourseChapterNo ?? 0; int CourseChapterNo = oguestModel?.CourseChapterNo ?? 0;
cList.ForEach(x => { x.SortNum = Convert.ToDouble(x.ChapterNo); }); cList.ForEach(x => { x.SortNum = Convert.ToDouble(x.ChapterNo); });
ChapterList.AddRange(cList.Where(x => x.SortNum <= CourseChapterNo).OrderByDescending(x=>x.SortNum).Select(x => new ChapterList.AddRange(cList.Where(x => x.SortNum <= CourseChapterNo).OrderByDescending(x => x.SortNum).Select(x => new
{ {
x.ChapterNo, x.ChapterNo,
x.ChapterName, x.ChapterName,
...@@ -3429,7 +3433,8 @@ namespace Edu.Module.Course ...@@ -3429,7 +3433,8 @@ namespace Edu.Module.Course
x.ChapterGradeNo, x.ChapterGradeNo,
State = 1, State = 1,
AppointState = 3, AppointState = 3,
AgainNum = 0 AgainNum = 0,
ClassDate = ""
})); }));
} }
Rlist.Add(new Rlist.Add(new
......
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