Commit 063519fe authored by 吴春's avatar 吴春

提交

parent 8d96b883
......@@ -44,6 +44,7 @@ namespace Mall.Model.Entity.Education
/// </summary>
public string TeacherLogo { get; set; }
public string LableName { get; set; }
/// <summary>
/// 专业
......
......@@ -13,6 +13,12 @@ namespace Mall.Model.Extend.Education
[DB(ConnectionName = "DefaultConnection")]
public class RB_Education_Article_Extend : RB_Education_Article
{
/// <summary>
/// 标签
/// </summary>
public List<string> LableNameList { get; set; }
/// <summary>
/// 开始时间
/// </summary>
......
......@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.Education
public class RB_Education_Teacher_Extend: Entity.Education.RB_Education_Teacher
{
/// <summary>
/// 标签
/// </summary>
public List<string> LableNameList { get; set; }
/// <summary>
/// 订单数
/// </summary>
......
......@@ -1359,6 +1359,10 @@ namespace Mall.Module.Education
{ nameof(RB_Education_Teacher_Extend.Name),model.Name},
{ nameof(RB_Education_Teacher_Extend.Telephone),model.Telephone},
{ nameof(RB_Education_Teacher_Extend.Introduction),model.Introduction},
{ nameof(RB_Education_Teacher_Extend.LableName),model.LableName},
{ nameof(RB_Education_Teacher_Extend.TeacherStatus),model.TeacherStatus},
{ nameof(RB_Education_Teacher_Extend.Major),model.Major},
{ nameof(RB_Education_Teacher_Extend.WorkYears),model.WorkYears},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
......@@ -2400,8 +2404,6 @@ namespace Mall.Module.Education
#endregion
#region 自动发放给会员优惠券
/// <summary>
/// 自动给会员发放优惠券
......
......@@ -320,5 +320,8 @@ namespace Mall.WebApi.Controllers.Education
#endregion
#region 教师
#endregion
}
}
\ No newline at end of file
......@@ -350,44 +350,57 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.ParamIsNull("请输入原价");
}
#region 教师验证
if (demodel.TeacherList == null || !demodel.TeacherList.Any()) {
if (demodel.TeacherList == null || !demodel.TeacherList.Any())
{
return ApiResult.ParamIsNull("请选择讲师列表");
}
foreach (var item in demodel.TeacherList) {
if ((item.TeacherId ?? 0) <= 0) {
foreach (var item in demodel.TeacherList)
{
if ((item.TeacherId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("讲师列表数据有误");
}
}
#endregion
#region 课程验证
if (demodel.CourseList == null || !demodel.CourseList.Any()) {
if (demodel.CourseList == null || !demodel.CourseList.Any())
{
return ApiResult.ParamIsNull("请选择课程列表");
}
foreach (var item in demodel.CourseList) {
if (item.Sort <= 0) {
foreach (var item in demodel.CourseList)
{
if (item.Sort <= 0)
{
return ApiResult.ParamIsNull();
}
if (string.IsNullOrEmpty(item.SortName)) {
if (string.IsNullOrEmpty(item.SortName))
{
return ApiResult.ParamIsNull("请传递章节名称");
}
if (string.IsNullOrEmpty(item.Name)) {
if (string.IsNullOrEmpty(item.Name))
{
return ApiResult.ParamIsNull("请传递课程名称");
}
if (item.Type <= 0) {
if (item.Type <= 0)
{
return ApiResult.ParamIsNull("请传递课程附件类型");
}
item.IsTrySee ??= 1;
item.Number ??= 1;
item.IsCache ??= 2;
if (string.IsNullOrEmpty(item.FilePath)) {
if (string.IsNullOrEmpty(item.FilePath))
{
return ApiResult.ParamIsNull("请传递附件");
}
if (item.Type == GoodsCourseTypeEnum.Video) {
if (string.IsNullOrEmpty(item.VideoImage)) {
if (item.Type == GoodsCourseTypeEnum.Video)
{
if (string.IsNullOrEmpty(item.VideoImage))
{
return ApiResult.ParamIsNull("请传递视频封面图");
}
if ((item.VideoTime ?? 0) <= 0) {
if ((item.VideoTime ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递视频时长");
}
}
......@@ -775,6 +788,10 @@ namespace Mall.WebApi.Controllers.Education
{
oldLogisticsModel = new RB_Education_Teacher_Extend();
}
if (!string.IsNullOrWhiteSpace(oldLogisticsModel.LableName))
{
oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName);
}
return ApiResult.Success("", oldLogisticsModel);
}
......@@ -834,6 +851,10 @@ namespace Mall.WebApi.Controllers.Education
query.CreateDate = System.DateTime.Now;
}
query.UpdateDate = System.DateTime.Now;
if (query.LableNameList != null && query.LableNameList.Any())
{
query.LableName = JsonConvert.SerializeObject(query.LableNameList);
}
bool result = educationModule.AddOrUpdateTeacher(query);
if (result)
{
......@@ -1458,7 +1479,10 @@ namespace Mall.WebApi.Controllers.Education
{
oldLogisticsModel = new RB_Education_Article_Extend();
}
if (!string.IsNullOrWhiteSpace(oldLogisticsModel.LableName))
{
oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName);
}
return ApiResult.Success("", oldLogisticsModel);
}
......@@ -1493,6 +1517,11 @@ namespace Mall.WebApi.Controllers.Education
query.CreateDate = System.DateTime.Now;
}
query.UpdateDate = System.DateTime.Now;
if (query.LableNameList != null && query.LableNameList.Any())
{
query.LableName = JsonConvert.SerializeObject(query.LableNameList);
}
bool result = educationModule.AddOrUpdateArticle(query);
if (result)
{
......@@ -1564,7 +1593,7 @@ namespace Mall.WebApi.Controllers.Education
{
return ApiResult.ParamIsNull("请输入评论时间");
}
if (demodel.ArticleId <= 0)
if (demodel.ArticleId <= 0)
{
return ApiResult.ParamIsNull("请选择咨询文章");
}
......
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