Commit 75117d0d authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents f022c5d1 b4e62ac0
......@@ -53,11 +53,17 @@ namespace Edu.Common.Enum.Course
[EnumField("专业课程")]
MAJOR = 7,
/// <summary>
/// 进阶课程
/// </summary>
[EnumField("进阶课程")]
Advanced = 8,
/// <summary>
/// 其它
/// </summary>
[EnumField("其他")]
OTHER = 8,
OTHER = 9,
}
/// <summary>
......@@ -82,6 +88,12 @@ namespace Edu.Common.Enum.Course
/// 新媒体
/// </summary>
[EnumField("新媒体")]
NewMedia =3
}
NewMedia =3,
/// <summary>
/// 新媒体运营
/// </summary>
[EnumField("新媒体运营")]
NewMediaOperation = 4
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using System;
using VT.FW.DB;
......@@ -65,5 +66,10 @@ namespace Edu.Model.Entity.Course
/// 学校Id
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 所属科目
/// </summary>
public CourseSubjectEnum CourseSubject { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using Edu.Common.Enum.Course;
namespace Edu.Model.ViewModel.Course
{
......@@ -24,6 +25,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string CateName { get; set; }
/// <summary>
/// 所属科目
/// </summary>
public CourseSubjectEnum CourseSubject { get; set; }
/// <summary>
/// 分类下级列表
/// </summary>
......
using Edu.Common;
using Edu.Common.Plugin;
using System;
using VT.FW.DB;
......@@ -47,5 +48,10 @@ namespace Edu.Model.ViewModel.Course
/// 关联课程数量
/// </summary>
public int CourseCount { get; set; }
/// <summary>
/// 所属科目名称
/// </summary>
public string CourseSubjectName { get { return this.CourseSubject.ToName(); } }
}
}
\ No newline at end of file
......@@ -97,6 +97,7 @@ namespace Edu.Module.Course
CateId = fItem.CateId,
CateName = fItem.CateName,
ParentId = fItem.ParentId,
CourseSubject=fItem.CourseSubject,
ChildList = new List<CourseCategoryTree_ViewModel>()
};
tModel.ChildList = GetCategoryTreeList(fItem.CateId, list);
......@@ -122,6 +123,7 @@ namespace Edu.Module.Course
CateId = item.CateId,
CateName = item.CateName,
ParentId = item.ParentId,
CourseSubject=item.CourseSubject,
ChildList = new List<CourseCategoryTree_ViewModel>(),
};
model.ChildList = GetCategoryTreeList(item.CateId, sourceList);
......@@ -147,6 +149,7 @@ namespace Edu.Module.Course
{nameof(RB_Course_Category_ViewModel.SortNum),model.SortNum },
{nameof(RB_Course_Category_ViewModel.UpdateBy),model.UpdateBy },
{nameof(RB_Course_Category_ViewModel.UpdateTime),model.UpdateTime },
{nameof(RB_Course_Category_ViewModel.CourseSubject),model.CourseSubject },
};
flag = categoryRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Category_ViewModel.CateId), model.CateId));
}
......
......@@ -69,7 +69,8 @@ WHERE 1=1
var parameters = new DynamicParameters();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.CourseCount,0) AS CourseCount
FROM RB_Course_Category AS A LEFT JOIN (SELECT COUNT(1) AS CourseCount,CateId FROM rb_course WHERE `Status`=0 GROUP BY CateId) AS B ON A.CateId=B.CateId
FROM RB_Course_Category AS A
LEFT JOIN (SELECT COUNT(1) AS CourseCount,CateId FROM rb_course WHERE `Status`=0 GROUP BY CateId) AS B ON A.CateId=B.CateId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.Status), (int)DateStateEnum.Normal);
......@@ -79,10 +80,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.Group_Id), query.Group_Id);
}
//if (query.School_Id > 0)
//{
// builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.School_Id), query.School_Id);
//}
if (query.CateId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.CateId), query.CateId);
......@@ -96,6 +93,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.ParentId), query.ParentId);
}
if (query.CourseSubject > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Category_ViewModel.CourseSubject), (int)query.CourseSubject);
}
}
builder.AppendFormat(@" ORDER BY A.{0} ASC ", nameof(RB_Course_Category_ViewModel.SortNum));
......
......@@ -45,6 +45,7 @@ namespace Edu.WebApi.Controllers.Course
var query = new RB_Course_Category_ViewModel()
{
CateName = base.ParmJObj.GetStringValue("CateName"),
CourseSubject = (CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
......@@ -121,7 +122,8 @@ namespace Edu.WebApi.Controllers.Course
CateName = base.ParmJObj.GetStringValue("CateName"),
ParentId = base.ParmJObj.GetInt("ParentId"),
SortNum = base.ParmJObj.GetInt("SortNum"),
Status = (DateStateEnum)base.ParmJObj.GetInt("Status")
Status = (DateStateEnum)base.ParmJObj.GetInt("Status"),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
extModel.CreateTime = DateTime.Now;
extModel.CreateBy = UserInfo.Id;
......@@ -194,7 +196,6 @@ namespace Edu.WebApi.Controllers.Course
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
query.Group_Id = base.UserInfo.Group_Id;
//query.School_Id = base.UserInfo.School_Id;
var list = courseModule.GetCoursePageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
......@@ -571,7 +572,7 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost]
public ApiResult GetCourseRateEnumList()
{
var list = Common.Plugin.EnumHelper.EnumToList(typeof(CourseRateEnum));
var list = Common.Plugin.EnumHelper.EnumToList(typeof(CourseRateEnum)).OrderBy(qitem=>qitem.Id);
return ApiResult.Success(data: list);
}
......
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