Commit 67a200ad authored by liudong1993's avatar liudong1993

增加课程标签

parent cf9be963
......@@ -549,5 +549,9 @@ namespace Mall.Model.Entity.Product
/// 课程分数
/// </summary>
public decimal? CourseScore { get; set; }
/// <summary>
/// 课程标签
/// </summary>
public string CourseLable { get; set; }
}
}
......@@ -40,6 +40,10 @@ namespace Mall.Model.Extend.Product
/// 线路描述list
/// </summary>
public List<string> LineDescriptionList { get; set; }
/// <summary>
/// 课程标签
/// </summary>
public List<string> CourseLableList { get; set; }
/// <summary>
/// 课程章节数
......
......@@ -581,6 +581,7 @@ namespace Mall.Module.Education
{ nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType },
{ nameof(RB_Goods.GoodsType),demodel.GoodsType },
{ nameof(RB_Goods.GoodsPageType),demodel.GoodsPageType },
{ nameof(RB_Goods.CourseLable),demodel.CourseLable}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
......
......@@ -3385,6 +3385,56 @@ namespace Mall.Module.Product
#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>
......
......@@ -154,6 +154,30 @@ namespace Mall.WebApi.Controllers.Education
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>
......
......@@ -219,6 +219,7 @@ namespace Mall.WebApi.Controllers.Education
model?.SupplierId,
model?.Commission,
model?.IsLiveGoods,
model?.SalesNum,
CategoryList = model?.CategoryList.Select(x => new
{
x.Id,
......@@ -301,7 +302,8 @@ namespace Mall.WebApi.Controllers.Education
x.VideoTime,
x.IsImageOK,
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
demodel.IntegralCommentType ??= 1;
demodel.GoodsPageType ??= GoodsPageTypeEnum.All;
demodel.CourseScore ??= 0;
demodel.CourseLableList ??= new List<string>();
demodel.CourseLable = JsonConvert.SerializeObject(demodel.CourseLableList);
bool flag = educationModule.SetProductGoodsInfo(demodel);
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