Commit ac0bf1b8 authored by 黄奎's avatar 黄奎

页面修改

parent e0fd2517
......@@ -40,5 +40,16 @@ namespace Edu.Model.ViewModel.Course
/// 下级列表
/// </summary>
public List<ChapterTree_ViewModel> ChildList { get; set; }
/// <summary>
/// 开发状态(1-开放,2-定时开放)
/// </summary>
public int OpenStatus { get; set; }
/// <summary>
/// 章节进度
/// </summary>
public int Progress { get; set; }
}
}
......@@ -107,7 +107,7 @@ namespace Edu.Module.Course
/// <returns></returns>
public RB_Course_ViewModel GetCourseModule(object CourseId)
{
var extModel= courseRepository.GetEntity<RB_Course_ViewModel>(CourseId);
var extModel = courseRepository.GetEntity<RB_Course_ViewModel>(CourseId);
if (extModel != null && extModel.CourseId > 0)
{
var stepPriceList = course_StepPriceRepository.GetCourseStepPriceListRepository(new RB_Course_StepPrice_ViewModel()
......@@ -131,7 +131,7 @@ namespace Edu.Module.Course
model.RenewOgPrice = 0;
model.RenewSlPrice = 0;
}
if (model.CourseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -170,7 +170,7 @@ namespace Edu.Module.Course
}
else//开启阶梯价格
{
var oldStepPriceList = course_StepPriceRepository.GetCourseStepPriceListRepository( new RB_Course_StepPrice_ViewModel() { CourseId=model.CourseId});
var oldStepPriceList = course_StepPriceRepository.GetCourseStepPriceListRepository(new RB_Course_StepPrice_ViewModel() { CourseId = model.CourseId });
//以前没有阶梯报价信息【直接新增】
if (oldStepPriceList == null || (oldStepPriceList != null && oldStepPriceList.Count == 0))
{
......@@ -374,19 +374,19 @@ namespace Edu.Module.Course
return treeList;
}
/// <summary>
/// 递归遍历所有章节
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="parentId">父节点编号</param>
/// <returns></returns>
public List<ChapterTree_ViewModel> GetChapterChild(List<RB_Course_Chapter_ViewModel> sourceList,int parentId)
/// <summary>
/// 递归遍历所有章节
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="parentId">父节点编号</param>
/// <returns></returns>
public List<ChapterTree_ViewModel> GetChapterChild(List<RB_Course_Chapter_ViewModel> sourceList, int parentId)
{
List<ChapterTree_ViewModel> resultList = new List<ChapterTree_ViewModel>();
//获取下级节点
var subList = sourceList?.Where(qItem => qItem.ParentId==parentId).OrderBy(qitem=>qitem.SortNum).ToList();
var subList = sourceList?.Where(qItem => qItem.ParentId == parentId).OrderBy(qitem => qitem.SortNum).ToList();
//如果存在下级节点
if (subList != null&& subList.Count>0)
if (subList != null && subList.Count > 0)
{
foreach (var childItem in subList)
{
......@@ -398,7 +398,9 @@ namespace Edu.Module.Course
ChapterName = childItem.ChapterName,
ChapterNo = childItem.ChapterNo,
CourseId = childItem.CourseId,
ChildList = new List<ChapterTree_ViewModel>()
ChildList = new List<ChapterTree_ViewModel>(),
OpenStatus = childItem.OpenStatus,
Progress = childItem.Progress
};
childModel.ChildList.AddRange(GetChapterChild(sourceList, childItem.ChapterId));
resultList.Add(childModel);
......
......@@ -194,7 +194,7 @@ namespace Edu.Module.System
var secondLevelList = list.Where(qitem => qitem.MenuLevel == 2 && qitem.ParentId == fItem.MenuId).ToList();
if (secondLevelList != null && secondLevelList.Count > 0)
{
foreach (var sItem in secondLevelList)
foreach (var sItem in secondLevelList.OrderBy(qitem => qitem.SortNum))
{
MenuTree_ViewModel sModel = new MenuTree_ViewModel()
{
......@@ -210,7 +210,7 @@ namespace Edu.Module.System
var thirdLevelList = list.Where(qitem => qitem.MenuLevel == 3 && qitem.ParentId == sItem.MenuId).ToList();
if (thirdLevelList != null && thirdLevelList.Count > 0)
{
foreach (var tItem in thirdLevelList)
foreach (var tItem in thirdLevelList.OrderBy(qitem => qitem.SortNum))
{
sModel.SubList.Add(new MenuTree_ViewModel()
{
......
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