Commit 0c0809c8 authored by 吴春's avatar 吴春

提交老师新增擅长课程字段

parent b7a30b2f
...@@ -46,6 +46,12 @@ namespace Mall.Model.Entity.Education ...@@ -46,6 +46,12 @@ namespace Mall.Model.Entity.Education
public string LableName { get; set; } public string LableName { get; set; }
/// <summary>
/// 擅长课程
/// </summary>
public string GoodCourse { get; set; }
/// <summary> /// <summary>
/// 专业 /// 专业
/// </summary> /// </summary>
......
...@@ -18,6 +18,11 @@ namespace Mall.Model.Extend.Education ...@@ -18,6 +18,11 @@ namespace Mall.Model.Extend.Education
/// </summary> /// </summary>
public List<string> LableNameList { get; set; } public List<string> LableNameList { get; set; }
/// <summary>
/// 擅长课程
/// </summary>
public List<string> GoodCourseList { get; set; }
/// <summary> /// <summary>
/// 订单数 /// 订单数
/// </summary> /// </summary>
......
...@@ -1770,6 +1770,7 @@ namespace Mall.Module.Education ...@@ -1770,6 +1770,7 @@ namespace Mall.Module.Education
{ nameof(RB_Education_Teacher_Extend.Nationality),model.Nationality}, { nameof(RB_Education_Teacher_Extend.Nationality),model.Nationality},
{ nameof(RB_Education_Teacher_Extend.ForeignersUrl),model.ForeignersUrl}, { nameof(RB_Education_Teacher_Extend.ForeignersUrl),model.ForeignersUrl},
{ nameof(RB_Education_Teacher_Extend.UserId),model.UserId}, { nameof(RB_Education_Teacher_Extend.UserId),model.UserId},
{ nameof(RB_Education_Teacher_Extend.GoodCourse),model.GoodCourse},
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
......
...@@ -415,6 +415,18 @@ namespace Mall.WebApi.Controllers.Education ...@@ -415,6 +415,18 @@ namespace Mall.WebApi.Controllers.Education
{ {
oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName); oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName);
} }
else
{
oldLogisticsModel.LableNameList = new List<string>();
}
if (!string.IsNullOrWhiteSpace(oldLogisticsModel.GoodCourse))
{
oldLogisticsModel.GoodCourseList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.GoodCourse);
}
else
{
oldLogisticsModel.GoodCourseList = new List<string>();
}
//获取老师的关注数 //获取老师的关注数
//判断是否已经关注过 //判断是否已经关注过
var oldList = educationModule.GetFollowTeacherList(new RB_Education_FollowTeacher_Extend { TeacherId = query.ID, MallBaseId = query.MallBaseId, TenantId = query.TenantId }); var oldList = educationModule.GetFollowTeacherList(new RB_Education_FollowTeacher_Extend { TeacherId = query.ID, MallBaseId = query.MallBaseId, TenantId = query.TenantId });
...@@ -473,6 +485,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -473,6 +485,7 @@ namespace Mall.WebApi.Controllers.Education
oldLogisticsModel?.WorkYears, oldLogisticsModel?.WorkYears,
oldLogisticsModel?.Major, oldLogisticsModel?.Major,
oldLogisticsModel?.LableNameList, oldLogisticsModel?.LableNameList,
oldLogisticsModel.GoodCourseList,
oldLogisticsModel?.Name, oldLogisticsModel?.Name,
oldLogisticsModel?.TeacherLogo, oldLogisticsModel?.TeacherLogo,
oldLogisticsModel?.Introduction, oldLogisticsModel?.Introduction,
......
...@@ -744,8 +744,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -744,8 +744,8 @@ namespace Mall.WebApi.Controllers.Education
x.Nationality, x.Nationality,
x.ForeignersUrl, x.ForeignersUrl,
x.LableName, x.LableName,
LableNameList = string.IsNullOrWhiteSpace(x.LableName) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(x.LableName) LableNameList = string.IsNullOrWhiteSpace(x.LableName) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(x.LableName),
GoodCourseList = string.IsNullOrWhiteSpace(x.GoodCourse) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(x.GoodCourse)
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
...@@ -804,6 +804,10 @@ namespace Mall.WebApi.Controllers.Education ...@@ -804,6 +804,10 @@ namespace Mall.WebApi.Controllers.Education
{ {
oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName); oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName);
} }
if (!string.IsNullOrWhiteSpace(oldLogisticsModel.GoodCourse))
{
oldLogisticsModel.GoodCourseList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.GoodCourse);
}
return ApiResult.Success("", oldLogisticsModel); return ApiResult.Success("", oldLogisticsModel);
} }
...@@ -858,6 +862,10 @@ namespace Mall.WebApi.Controllers.Education ...@@ -858,6 +862,10 @@ namespace Mall.WebApi.Controllers.Education
{ {
return ApiResult.Failed("请输入简介"); return ApiResult.Failed("请输入简介");
} }
if (query.GoodCourseList==null||!query.GoodCourseList.Any())
{
return ApiResult.Failed("请输入擅长课程");
}
if (query.ID == 0) if (query.ID == 0)
{ {
query.CreateDate = System.DateTime.Now; query.CreateDate = System.DateTime.Now;
...@@ -871,6 +879,14 @@ namespace Mall.WebApi.Controllers.Education ...@@ -871,6 +879,14 @@ namespace Mall.WebApi.Controllers.Education
{ {
query.LableName = ""; query.LableName = "";
} }
if (query.GoodCourseList != null && query.GoodCourseList.Any())
{
query.GoodCourse = JsonConvert.SerializeObject(query.GoodCourseList);
}
else
{
query.GoodCourse = "";
}
bool result = educationModule.AddOrUpdateTeacher(query); bool result = educationModule.AddOrUpdateTeacher(query);
if (result) if (result)
{ {
......
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