Commit 3158a807 authored by liudong1993's avatar liudong1993

日语培训 调整

parent 4a69f56a
......@@ -41,7 +41,7 @@ namespace Edu.Model.ViewModel.Course
/// <summary>
/// 周几
/// </summary>
public string WeekDay { get; set; }
public int WeekDay { get; set; }
/// <summary>
/// 班级对应的老师id
......
......@@ -97,33 +97,36 @@ namespace Edu.Module.Course
string classIds = string.Join(",", list.Select(x => x.ClassId));
//查询阶梯价格
var stepList = class_StepPriceRepository.GetClassStepPriceListRepository(new RB_Class_StepPrice_ViewModel() { QClassIds = classIds });
//查询课程安排
List<RB_Class_Plan_ViewModel> PlanWeek = new List<RB_Class_Plan_ViewModel>();
List<RB_Class_Plan_ViewModel> PlanFixed = new List<RB_Class_Plan_ViewModel>();
string k1classIds = string.Join(",", list.Where(x => x.ClassStyle == Common.Enum.Course.ClassStyleEnum.Week || x.ClassStyle == Common.Enum.Course.ClassStyleEnum.Month).Select(x => x.ClassId));
if (!string.IsNullOrEmpty(k1classIds))
{
PlanWeek = class_PlanRepository.GetClassPlanForProduct(k1classIds);
}
string k2classIds = string.Join(",", list.Where(x => x.ClassStyle == Common.Enum.Course.ClassStyleEnum.FixedDate).Select(x => x.ClassId));
if (!string.IsNullOrEmpty(k2classIds))
{
PlanFixed = class_PlanRepository.GetClassPlanListRepository(new RB_Class_Plan_ViewModel() { QClassIds = k2classIds });
}
//查询课程时间
var TimeList = class_TimeRepository.GetClassTimeForProduct(classIds);
foreach (var item in list)
{
item.ClassStepPriceList = stepList.Where(x => x.ClassId == item.ClassId).OrderBy(x => x.PersionNum).ToList();
item.ClassTimeList = new List<RB_Class_Time_ViewModel>();
if (item.ClassStyle != Common.Enum.Course.ClassStyleEnum.OnLine)
{
item.ClassTimeList = TimeList.Where(x => x.ClassId == item.ClassId).OrderBy(x => x.StartTime).ToList();
if (!string.IsNullOrEmpty(item.DefaultTimeJson))
{
item.ClassTimeList = JsonHelper.DeserializeObject<List<RB_Class_Time_ViewModel>>(item.DefaultTimeJson);
}
}
item.ClassPlanList = new List<RB_Class_Plan_ViewModel>();
if (item.ClassStyle == Common.Enum.Course.ClassStyleEnum.Week || item.ClassStyle == Common.Enum.Course.ClassStyleEnum.Month)
{
item.ClassPlanList = PlanWeek.Where(x => x.ClassId == item.ClassId).ToList();
if (!string.IsNullOrEmpty(item.DateJson))
{
List<int> DayList = JsonHelper.DeserializeObject<List<int>>(item.DateJson);
foreach (var qitem in DayList) {
item.ClassPlanList.Add(new RB_Class_Plan_ViewModel()
{
WeekDay = qitem
});
}
}
}
else if (item.ClassStyle == Common.Enum.Course.ClassStyleEnum.FixedDate)
{
......
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