Commit e1d45777 authored by liudong1993's avatar liudong1993

解决冲突

parents 169870a7 a2e56b96
......@@ -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>
......
......@@ -41,6 +41,16 @@ namespace Mall.Model.Extend.Product
/// </summary>
public List<string> LineDescriptionList { get; set; }
/// <summary>
/// 课程章节数
/// </summary>
public int CourseNum { get; set; }
/// <summary>
/// 教师id
/// </summary>
public int TeacherId { get; set; }
#region 司导信息
/// <summary>
/// 站点名称
......
......@@ -780,7 +780,8 @@ namespace Mall.Module.Education
var coinsertList = demodel.CourseList.Where(x => !courselist.Select(y => y.Id).Contains(x.Id)).ToList();
var codeleteList = courselist.Where(x => !demodel.CourseList.Select(y => y.Id).Contains(x.Id)).ToList();
var coupdateList = courselist.Where(x => demodel.CourseList.Select(y => y.Id).Contains(x.Id)).ToList();
foreach (var item in coinsertList) {
foreach (var item in coinsertList)
{
int courseId = goods_WK_CourseRepository.Insert(new RB_Goods_WK_Course()
{
Id = 0,
......@@ -824,11 +825,13 @@ namespace Mall.Module.Education
}));
}
}
foreach (var item in coupdateList) {
foreach (var item in coupdateList)
{
var courseModel = demodel.CourseList.Where(x => x.Id == item.Id).FirstOrDefault();
if (courseModel == null) { continue; }
bool IsUpdateImage = false;
if (item.FilePath != courseModel.FilePath) {
if (item.FilePath != courseModel.FilePath)
{
IsUpdateImage = true;
}
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
......@@ -878,7 +881,8 @@ namespace Mall.Module.Education
}));
}
}
foreach (var item in codeleteList) {
foreach (var item in codeleteList)
{
goods_WK_CourseRepository.Delete(item);
}
#endregion
......@@ -976,7 +980,8 @@ namespace Mall.Module.Education
});
}
//插入课程列表
foreach (var item in demodel.CourseList) {
foreach (var item in demodel.CourseList)
{
int courseId = goods_WK_CourseRepository.Insert(new RB_Goods_WK_Course()
{
Id = 0,
......@@ -1010,7 +1015,8 @@ namespace Mall.Module.Education
UserName = "guest",
Password = "viitto2019",
QueenName = RabbitKey.QUEEN_GENERATE_EDUCARION
}, JsonConvert.SerializeObject(new {
}, JsonConvert.SerializeObject(new
{
GoodsId = Id,
CourseId = courseId,
item.FilePath,
......@@ -1137,6 +1143,37 @@ namespace Mall.Module.Education
return true;
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_Extend> GetListByTeacherId(int pageIndex, int pageSize, out long rowCount, RB_Goods_Extend dmodel)
{
var list = goodsRepository.GetListByTeacherId(pageIndex, pageSize, out rowCount, dmodel);
if (list.Any())
{
foreach (var item in list)
{
//轮播图
item.CoverImage = "";
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(item.CarouselImage);
//封面图
item.CoverImage = CarouselIdList[0];
}
}
}
return list;
}
#endregion
#region 教师管理
......@@ -1215,6 +1252,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(){
......@@ -1928,7 +1969,7 @@ namespace Mall.Module.Education
}
/// <summary>
///资讯列表
/// </summary>
......@@ -1945,6 +1986,19 @@ namespace Mall.Module.Education
}
/// <summary>
/// 获取资讯实体
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public RB_Education_Article GetArticleEntity(int id)
{
return educationArticleRepository.GetEntity(id);
}
/// <summary>
/// 资讯配置
/// </summary>
......@@ -1982,6 +2036,7 @@ namespace Mall.Module.Education
{ nameof(RB_Education_Article_Extend.ShelvesDate),model.ShelvesDate},
{ nameof(RB_Education_Article_Extend.Sort),model.Sort},
{ nameof(RB_Education_Article_Extend.ArticlePic),model.ArticlePic},
{ nameof(RB_Education_Article_Extend.TeacherId),model.TeacherId},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
......@@ -2002,6 +2057,25 @@ namespace Mall.Module.Education
}
/// <summary>
/// 更新资讯浏览数
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool UpdateArticleBrowseNum(RB_Education_Article_Extend model)
{
bool flag = false;
try
{
flag = educationArticleRepository.UpdateBrowseNum(model.ID);
}
catch (Exception ex)
{
LogHelper.Write(ex, "UpdateArticleBrowseNum");
return false;
}
return flag;
}
/// <summary>
/// 批量上下架资讯
......@@ -2111,7 +2185,7 @@ namespace Mall.Module.Education
#endregion
#region 教育-资讯评论管理
/// <summary>
/// 获取订单评论分页列表
/// </summary>
......@@ -2147,9 +2221,9 @@ namespace Mall.Module.Education
/// <returns></returns>
public bool SetArticleCommentInfo(RB_Education_ArticleComment_Extend demodel)
{
bool flag = educationArticleCommentRepository.Insert(demodel) > 0;
return flag;
}
......@@ -2224,8 +2298,6 @@ namespace Mall.Module.Education
#endregion
#region 自动发放给会员优惠券
/// <summary>
/// 自动给会员发放优惠券
......@@ -2278,8 +2350,8 @@ namespace Mall.Module.Education
GetType = item.TriggerType,
UseType = item.UseType,
Name = item.Name,
HeXiao=item.HeXiao,
UseHeXiao=0
HeXiao = item.HeXiao,
UseHeXiao = 0
};
isReceive = memberCouponRepository.Insert(nowMemberCoupon, trans) > 0;
......
......@@ -29,7 +29,7 @@ namespace Mall.Repository.Education
StringBuilder builder = new StringBuilder();
builder.Append(@$" SELECT a.*,b.CommentNum,c.Major,c.TeacherLogo,c.`Name` as TeacherName FROM {TableName} as a LEFT JOIN (SELECT ArticleId,COUNT(*) as CommentNum from rb_education_articlecomment where `Status`=0 GROUP BY ArticleId )
as b on a.ID = b.ArticleId
LEFT JOIN rb_education_teacher as c on a.TeacherId=c.ID WHERE a.{nameof(RB_Education_Article_Extend.Status)}=0 and c.{nameof(RB_Education_Teacher.Status)}=0");
LEFT JOIN rb_education_teacher as c on a.TeacherId=c.ID and c.{nameof(RB_Education_Teacher.Status)}=0 WHERE a.{nameof(RB_Education_Article_Extend.Status)}=0 ");
if (query != null)
{
if (query.TenantId > 0)
......@@ -85,8 +85,8 @@ LEFT JOIN rb_education_teacher as c on a.TeacherId=c.ID WHERE a.{nameof(RB_Educ
{
StringBuilder builder = new StringBuilder();
builder.Append(@$" SELECT a.*,b.CommentNum,c.Major,c.TeacherLogo,c.`Name` as TeacherName FROM {TableName} as a LEFT JOIN (SELECT ArticleId,COUNT(*) as CommentNum from rb_education_articlecomment where `Status`=0 GROUP BY ArticleId )
as b on a.ID = b.ArticleId
LEFT JOIN rb_education_teacher as c on a.TeacherId = c.ID WHERE a.{nameof(RB_Education_Article_Extend.Status)}=0 and c.{nameof(RB_Education_Teacher.Status)}=0");
as b on a.ID = b.ArticleId
LEFT JOIN rb_education_teacher as c on a.TeacherId=c.ID and c.{nameof(RB_Education_Teacher.Status)}=0 WHERE a.{nameof(RB_Education_Article_Extend.Status)}=0 ");
if (query != null)
{
if (query.TenantId > 0)
......@@ -124,5 +124,24 @@ LEFT JOIN rb_education_teacher as c on a.TeacherId = c.ID WHERE a.{nameof(RB_Ed
}
return Get<RB_Education_Article_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 更新浏览数
/// </summary>
/// <param name="ID"></param>
/// <returns></returns>
public bool UpdateBrowseNum(int ID)
{
var obj = ExecuteScalar($"update rb_education_article set BrowseNum=BrowseNum+1 where ID={ID}");
if (obj != null)
{
return true;
}
return false;
}
}
}
......@@ -1148,5 +1148,78 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
}
#endregion
#region 网课教育
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Goods_Extend> GetListByTeacherId(int pageIndex, int pageSize, out long rowCount, RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.GoodsClassify=2 and g.{nameof(RB_Goods_Extend.GoodsStatus)}=1 and b.`Status`=0";
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.NotTenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}<>{dmodel.NotTenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.IsSelectSellOut == 1)
{
where += $@" and g.{nameof(RB_Goods_Extend.InventoryNum)}<=0";
}
if (!string.IsNullOrEmpty(dmodel.CategoryIds))
{
where += $@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
}
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
}
if (dmodel.IsProxy > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
if (dmodel.TeacherId > 0)
{
where += $@" and b.{nameof(RB_Goods_Extend.TeacherId)}={dmodel.TeacherId}";
}
string orderBy = " g.Sort desc";
string sql = $@" SELECT g.*,c.CourseNum from rb_goods as g
LEFT JOIN rb_goods_wk_teacher as b on g.Id=b.GoodsId
LEFT JOIN (SELECT GoodsId,COUNT(*) as CourseNum from rb_goods_wk_course where `Status`=0 GROUP BY GoodsId) as c on c.GoodsId=g.Id where {where} order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
#endregion
}
}
......@@ -269,5 +269,62 @@ namespace Mall.WebApi.Controllers.Education
}
}
#endregion
#region 资讯留言
/// <summary>
/// 管理新增评论
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetArticleCommentInfo()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_Education_ArticleComment_Extend demodel = JsonConvert.DeserializeObject<RB_Education_ArticleComment_Extend>(req.msg.ToString());
if (demodel.ArticleId <= 0)
{
return ApiResult.ParamIsNull("请选择资讯");
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请输入评价内容");
}
var articleModle = educationModule.GetArticleEntity(demodel.ArticleId);
if (articleModle == null)
{
return ApiResult.ParamIsNull("资讯信息不存在");
}
if (articleModle.IsComment == 0)
{
return ApiResult.ParamIsNull("资讯不允许留言");
}
demodel.CommentGrade ??= Common.Enum.Goods.GoodsCommentTypeEnum.Praise;
demodel.CommentScore ??= 5;
demodel.CommentImage = "";
if (demodel.CommentImgList != null && demodel.CommentImgList.Any())
{
demodel.CommentImage = JsonConvert.SerializeObject(demodel.CommentImgList);
}
demodel.UserId = userInfo.UserId;
demodel.UserName = userInfo.Name;
demodel.PlatformSource = userInfo.Source;
demodel.UserPhoto ??= 0;
demodel.Is_Top ??= 2;
demodel.Is_Show ??= 1;
demodel.Is_Anonymity ??= 2;
demodel.Reply ??= "";
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.Status = 0;
demodel.UpdateDate = DateTime.Now;
demodel.CreateDate = DateTime.Now;
bool flag = educationModule.SetArticleCommentInfo(demodel);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
}
#endregion
}
}
\ No newline at end of file
......@@ -4,12 +4,13 @@ using Microsoft.AspNetCore.Mvc;
using Mall.Module.Education;
using Mall.Common.API;
using Newtonsoft.Json;
using Mall.Model.Extend.Education;
using System;
using System.Linq;
using Mall.Model.Extend.Product;
using Mall.Module.Product;
using Mall.Model.Extend.User;
using System.Collections.Generic;
using System.Linq;
using System;
using Newtonsoft.Json.Linq;
using Mall.Common.Plugin;
......@@ -88,7 +89,6 @@ namespace Mall.WebApi.Controllers.Education
price_member = Math.Round((model.SellingPrice ?? 0) * (memberGrade?.Discount ?? 10) / 10, 2, MidpointRounding.AwayFromZero);
}
}
#endregion
#region 会员价格
......@@ -199,6 +199,169 @@ namespace Mall.WebApi.Controllers.Education
#endregion
#region 资讯
/// <summary>
/// 小程序分页列表(赞羊)
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetArticlePageList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (parms.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Education_Article_Extend demodel = JsonConvert.DeserializeObject<RB_Education_Article_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.ArticleStatus = 1;//只查询销售中的
var list = educationModule.GetArticlePageListRepository(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.Name,
CreateDateStr = x.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
x.ArticleStatus,
x.IsComment,
x.CommentNum,
x.BrowseNum,
x.FictitiousBrowseNum,
x.ArticlePic,
x.TeacherName,
x.TeacherLogo,
x.Major
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取详情
/// </summary>
/// <returns></returns>
public ApiResult GetArticleModel(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (parms.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
var query = JsonConvert.DeserializeObject<RB_Education_Article_Extend>(parms.msg.ToString());
query.TenantId = parms.TenantId;
query.MallBaseId = parms.MallBaseId;
query.ArticleStatus = 1;
var oldLogisticsModel = educationModule.GetArticleInfo(query);
if (oldLogisticsModel == null)
{
oldLogisticsModel = new RB_Education_Article_Extend();
}
//更新浏览数
try
{
if (oldLogisticsModel.ID > 0)
{
educationModule.UpdateArticleBrowseNum(oldLogisticsModel);
}
}
catch (Exception ex)
{
}
return ApiResult.Success("", oldLogisticsModel);
}
/// <summary>
/// 获取商品评论分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetArticleCommentPageList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Education_ArticleComment_Extend demodel = JsonConvert.DeserializeObject<RB_Education_ArticleComment_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = educationModule.GetArticleCommentPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.UserId,
x.UserName,
x.ArticleId,
x.ArticleName,
x.CommentScore,
x.CommentGrade,
CommentGradeName = x.CommentGrade.GetEnumName(),
x.CommentImgList,
x.Content,
x.Reply,
x.Is_Top,
x.Is_Show,
x.Is_Anonymity,
x.PlatformSource,
x.TenantId,
x.MallBaseId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
return ApiResult.Success("", pagelist);
}
#endregion
#region 教师
/// <summary>
/// 获取详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetTeacherModel(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
var query = JsonConvert.DeserializeObject<RB_Education_Teacher_Extend>(parms.msg.ToString());
query.TenantId = parms.TenantId;
query.MallBaseId = parms.MallBaseId;
query.TeacherStatus = 1;
var oldLogisticsModel = educationModule.GetTeacherModel(query);
if (oldLogisticsModel == null)
{
oldLogisticsModel = new RB_Education_Teacher_Extend();
}
if (!string.IsNullOrWhiteSpace(oldLogisticsModel.LableName))
{
oldLogisticsModel.LableNameList = JsonConvert.DeserializeObject<List<string>>(oldLogisticsModel.LableName);
}
//获取老师对应的课程
var goodsList = educationModule.GetListByTeacherId(1, 4, out long count, new RB_Goods_Extend { TeacherId = oldLogisticsModel.ID, TenantId = oldLogisticsModel.TenantId, MallBaseId = oldLogisticsModel.MallBaseId });
var goodsResult = goodsList.Select(x => new
{
x.CoverImage,
x.Name,
x.CourseNum
});
var teacherResult = new {
oldLogisticsModel?.WorkYears,
oldLogisticsModel?.Major,
oldLogisticsModel?.LableNameList,
oldLogisticsModel?.Name,
oldLogisticsModel?.TeacherLogo,
oldLogisticsModel?.Introduction
};
return ApiResult.Success("", new { teacherResult, goodsResult });
}
#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("请传递视频时长");
}
}
......@@ -763,6 +776,7 @@ namespace Mall.WebApi.Controllers.Education
/// 获取详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetTeacherModel()
{
var parms = RequestParm;
......@@ -775,6 +789,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 +852,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 +1480,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);
}
......@@ -1484,7 +1509,7 @@ namespace Mall.WebApi.Controllers.Education
{
return ApiResult.Failed("请输入资讯标题");
}
if (string.IsNullOrWhiteSpace(query.LableName))
if (query.LableNameList==null|| !query.LableNameList.Any())
{
return ApiResult.Failed("请输入标签");
}
......@@ -1493,6 +1518,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 +1594,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