Commit 67a200ad authored by liudong1993's avatar liudong1993

增加课程标签

parent cf9be963
...@@ -549,5 +549,9 @@ namespace Mall.Model.Entity.Product ...@@ -549,5 +549,9 @@ namespace Mall.Model.Entity.Product
/// 课程分数 /// 课程分数
/// </summary> /// </summary>
public decimal? CourseScore { get; set; } public decimal? CourseScore { get; set; }
/// <summary>
/// 课程标签
/// </summary>
public string CourseLable { get; set; }
} }
} }
...@@ -40,6 +40,10 @@ namespace Mall.Model.Extend.Product ...@@ -40,6 +40,10 @@ namespace Mall.Model.Extend.Product
/// 线路描述list /// 线路描述list
/// </summary> /// </summary>
public List<string> LineDescriptionList { get; set; } public List<string> LineDescriptionList { get; set; }
/// <summary>
/// 课程标签
/// </summary>
public List<string> CourseLableList { get; set; }
/// <summary> /// <summary>
/// 课程章节数 /// 课程章节数
......
...@@ -562,25 +562,26 @@ namespace Mall.Module.Education ...@@ -562,25 +562,26 @@ namespace Mall.Module.Education
{ nameof(RB_Goods.IsLiveGoods),demodel.IsLiveGoods}, { nameof(RB_Goods.IsLiveGoods),demodel.IsLiveGoods},
{ nameof(RB_Goods.ShelvesDate),demodel.ShelvesDate }, { nameof(RB_Goods.ShelvesDate),demodel.ShelvesDate },
{ nameof(RB_Goods.DownDate),demodel.DownDate }, { nameof(RB_Goods.DownDate),demodel.DownDate },
{ nameof(RB_Goods.SendArea),demodel.SendArea }, { nameof(RB_Goods.SendArea),demodel.SendArea },
{ nameof(RB_Goods.SiteId),demodel.SiteId }, { nameof(RB_Goods.SiteId),demodel.SiteId },
{ nameof(RB_Goods.GuideId),demodel.GuideId }, { nameof(RB_Goods.GuideId),demodel.GuideId },
{ nameof(RB_Goods.CarId),demodel.CarId }, { nameof(RB_Goods.CarId),demodel.CarId },
{ nameof(RB_Goods.CarColorId),demodel.CarColorId }, { nameof(RB_Goods.CarColorId),demodel.CarColorId },
{ nameof(RB_Goods.CarNumber),demodel.CarNumber }, { nameof(RB_Goods.CarNumber),demodel.CarNumber },
{ nameof(RB_Goods.CarBuyYear),demodel.CarBuyYear }, { nameof(RB_Goods.CarBuyYear),demodel.CarBuyYear },
{ nameof(RB_Goods.CarType),demodel.CarType }, { nameof(RB_Goods.CarType),demodel.CarType },
{ nameof(RB_Goods.UseDay),demodel.UseDay }, { nameof(RB_Goods.UseDay),demodel.UseDay },
{ nameof(RB_Goods.LineName),demodel.LineName }, { nameof(RB_Goods.LineName),demodel.LineName },
{ nameof(RB_Goods.LineDescription),demodel.LineDescription }, { nameof(RB_Goods.LineDescription),demodel.LineDescription },
{ nameof(RB_Goods.IsSpell),demodel.IsSpell }, { nameof(RB_Goods.IsSpell),demodel.IsSpell },
{ nameof(RB_Goods.RideNum),demodel.RideNum }, { nameof(RB_Goods.RideNum),demodel.RideNum },
{ nameof(RB_Goods.AdvanceDay),demodel.AdvanceDay }, { nameof(RB_Goods.AdvanceDay),demodel.AdvanceDay },
{ nameof(RB_Goods.VideoType),demodel.VideoType }, { nameof(RB_Goods.VideoType),demodel.VideoType },
{ nameof(RB_Goods.IntegralComment),demodel.IntegralComment }, { nameof(RB_Goods.IntegralComment),demodel.IntegralComment },
{ nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType }, { nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType },
{ nameof(RB_Goods.GoodsType),demodel.GoodsType }, { nameof(RB_Goods.GoodsType),demodel.GoodsType },
{ nameof(RB_Goods.GoodsPageType),demodel.GoodsPageType }, { nameof(RB_Goods.GoodsPageType),demodel.GoodsPageType },
{ nameof(RB_Goods.CourseLable),demodel.CourseLable}
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper(){
......
...@@ -3385,6 +3385,56 @@ namespace Mall.Module.Product ...@@ -3385,6 +3385,56 @@ namespace Mall.Module.Product
#endregion #endregion
} }
/// <summary>
/// 获取课程是否收藏
/// </summary>
/// <param name="goodsId"></param>
/// <param name="userId"></param>
/// <param name="smallShopsId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public object GetAppletCourseCollect(int goodsId, int UserId, int TenantId, int MallBaseId)
{
if (UserId > 0)
{
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Member_Collection_Extend.UserId),
FiledValue=UserId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Member_Collection_Extend.GoodsId),
FiledValue=goodsId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Member_Collection_Extend.TenantId),
FiledValue=TenantId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Member_Collection_Extend.MallBaseId),
FiledValue=MallBaseId,
OperatorEnum=OperatorEnum.Equal
},
};
if (member_CollectionRepository.Exists(wheres))
{
return new
{
Favorite = true
};
}
}
return new
{
Favorite = false
};
}
/// <summary> /// <summary>
/// 获取小程序课程章节列表 /// 获取小程序课程章节列表
/// </summary> /// </summary>
......
...@@ -154,6 +154,30 @@ namespace Mall.WebApi.Controllers.Education ...@@ -154,6 +154,30 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
/// <summary>
/// 获取课程是否收藏
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletCourseCollect(object requestMsg) {
var req = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (req.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
JObject prams = JObject.Parse(req.msg.ToString());
int GoodsId = prams.GetInt("GoodsId", 0);
if (GoodsId <= 0)
{
return ApiResult.ParamIsNull();
}
int UserId = req.UserId;
var Robj = productModule.GetAppletCourseCollect(GoodsId, UserId, req.TenantId, req.MallBaseId);
return ApiResult.Success("", Robj);
}
/// <summary> /// <summary>
/// 获取小程序课程章节列表 /// 获取小程序课程章节列表
/// </summary> /// </summary>
......
...@@ -219,6 +219,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -219,6 +219,7 @@ namespace Mall.WebApi.Controllers.Education
model?.SupplierId, model?.SupplierId,
model?.Commission, model?.Commission,
model?.IsLiveGoods, model?.IsLiveGoods,
model?.SalesNum,
CategoryList = model?.CategoryList.Select(x => new CategoryList = model?.CategoryList.Select(x => new
{ {
x.Id, x.Id,
...@@ -301,7 +302,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -301,7 +302,8 @@ namespace Mall.WebApi.Controllers.Education
x.VideoTime, x.VideoTime,
x.IsImageOK, x.IsImageOK,
ImageList = !string.IsNullOrEmpty(x.Image) && x.Image != "[]" ? JsonConvert.DeserializeObject<List<CourseImageModel>>(x.Image) : new List<CourseImageModel>() ImageList = !string.IsNullOrEmpty(x.Image) && x.Image != "[]" ? JsonConvert.DeserializeObject<List<CourseImageModel>>(x.Image) : new List<CourseImageModel>()
}) }),
CourseLableList = !string.IsNullOrEmpty(model?.CourseLable) && model?.CourseLable != "[]" ? JsonConvert.DeserializeObject<List<string>>(model?.CourseLable) : new List<string>()
}); });
} }
...@@ -617,6 +619,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -617,6 +619,8 @@ namespace Mall.WebApi.Controllers.Education
demodel.IntegralCommentType ??= 1; demodel.IntegralCommentType ??= 1;
demodel.GoodsPageType ??= GoodsPageTypeEnum.All; demodel.GoodsPageType ??= GoodsPageTypeEnum.All;
demodel.CourseScore ??= 0; demodel.CourseScore ??= 0;
demodel.CourseLableList ??= new List<string>();
demodel.CourseLable = JsonConvert.SerializeObject(demodel.CourseLableList);
bool flag = educationModule.SetProductGoodsInfo(demodel); bool flag = educationModule.SetProductGoodsInfo(demodel);
if (flag) if (flag)
......
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