Commit a6c3b3d1 authored by 黄奎's avatar 黄奎

页面修改

parent b9d89f22
......@@ -100,7 +100,7 @@ namespace Edu.Model.Entity.Course
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
public double SortNum { get; set; }
/// <summary>
/// 学习课时
......
......@@ -485,7 +485,7 @@ namespace Edu.Module.Course
{
List<ChapterTree_ViewModel> resultList = new List<ChapterTree_ViewModel>();
//获取下级节点
var subList = sourceList?.Where(qItem => qItem.ParentId == parentId).OrderBy(qitem =>qitem.OrderFileds).ToList();
var subList = sourceList?.Where(qItem => qItem.ParentId == parentId).OrderBy(qitem =>qitem.SortNum).ToList();
//如果存在下级节点
if (subList != null && subList.Count > 0)
{
......
......@@ -54,12 +54,14 @@ namespace Edu.Repository.Course
public bool SetBatchUpdateChapterNoRepository(List<RB_Course_Chapter_ViewModel> param)
{
StringBuilder builder = new StringBuilder();
builder.Append("INSERT INTO rb_course_chapter (ChapterId, ChapterNo, ParentId) VALUES");
builder.Append("INSERT INTO rb_course_chapter (ChapterId, ChapterNo, ParentId,SortNum) VALUES");
param.ForEach(x => {
builder.Append($"({x.ChapterId},'{x.ChapterNo}',{x.ParentId}),");
var newChapterNo = x.ChapterNo.Replace(".", "");
double.TryParse(newChapterNo, out double SortNum);
builder.Append($"({x.ChapterId},'{x.ChapterNo}',{x.ParentId},{SortNum}),");
});
builder = builder.Remove(builder.Length - 1, 1);
builder.Append("ON DUPLICATE KEY UPDATE ChapterNo=VALUES(ChapterNo), ParentId=VALUES(ParentId);");
builder.Append("ON DUPLICATE KEY UPDATE ChapterNo=VALUES(ChapterNo),ParentId=VALUES(ParentId),SortNum=VALUES(SortNum);");
return Execute(builder.ToString()) > 0;
}
......
......@@ -430,7 +430,6 @@ namespace Edu.WebApi.Controllers.Course
ParentId=base.ParmJObj.GetInt("ParentId"),
OpenStatus=base.ParmJObj.GetInt("OpenStatus"),
Progress=base.ParmJObj.GetInt("Progress"),
SortNum=base.ParmJObj.GetInt("SortNum"),
StudyHours=base.ParmJObj.GetInt("StudyHours"),
StudyMinutes=base.ParmJObj.GetInt("StudyMinutes"),
Objectives=base.ParmJObj.GetStringValue("Objectives"),
......
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