Commit bcfb6b13 authored by liudong1993's avatar liudong1993

调整

parent caafd04f
......@@ -3469,19 +3469,28 @@ namespace Mall.Module.Product
/// <param name="goodsId"></param>
/// <param name="UserId"></param>
/// <returns></returns>
public bool GetAppletCourseIsPay(int goodsId, int UserId) {
public int GetAppletCourseIsPay(int goodsId, int UserId) {
if (UserId <= 0) {
return false;
return 0;
}
var goodsModel = goodsRepository.GetEntity(goodsId);
if (goodsModel == null) {
return 0;
}
if (goodsModel.SellingPrice == 0) {
return 1;
}
var omodel = goods_OrderRepository.GetCourseOrderIsPay(GoodsIds: goodsId.ToString(), UserId: UserId).FirstOrDefault();
if (omodel != null)
{
if (omodel.PaymentTime.HasValue)
{
return true;
return 1;
}
return 2;
}
return false;
return 0;
}
#endregion
......
......@@ -154,7 +154,7 @@ GROUP BY DATE_FORMAT(CreateDate,'%Y-%m-%d') ORDER BY DATE_FORMAT(CreateDate,'%Y-
/// <returns></returns>
public RB_Goods_WK_StudyTime_Extend GetMyStudyTimeByLast(int userId)
{
string sql = $@"SELECT *FROM rb_goods_wk_studytime WHERE UserId = {userId} limit 1";
string sql = $@"SELECT * FROM rb_goods_wk_studytime WHERE UserId = {userId} order by Id desc limit 1 ";
return Get<RB_Goods_WK_StudyTime_Extend>(sql).FirstOrDefault();
}
......
......@@ -201,7 +201,7 @@ namespace Mall.WebApi.Controllers.Education
}
var list = productModule.GetAppletGoodsCourseList(pagelist.pageIndex, pagelist.pageSize, out long count, GoodsId, req.UserId, req.TenantId, req.MallBaseId);
bool IsPay = productModule.GetAppletCourseIsPay(GoodsId, req.UserId);
int IsPay = productModule.GetAppletCourseIsPay(GoodsId, req.UserId);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
......@@ -214,7 +214,7 @@ namespace Mall.WebApi.Controllers.Education
x.IsTrySee,
x.Number,
x.IsCache,
FilePath = x.IsTrySee == 1 || IsPay ? x.FilePath : "",
FilePath = x.IsTrySee == 1 || IsPay == 1 ? x.FilePath : "",
x.IsImageOK,
x.VideoImage,
x.VideoTime,
......@@ -233,13 +233,13 @@ namespace Mall.WebApi.Controllers.Education
/// <param name="Number"></param>
/// <param name="Image"></param>
/// <returns></returns>
public List<CourseImageModel> GetCourseImage(int IsTrySee, bool IsPay, int Number, string Image)
public List<CourseImageModel> GetCourseImage(int IsTrySee, int IsPay, int Number, string Image)
{
if (string.IsNullOrEmpty(Image) || Image == "[]")
{
return new List<CourseImageModel>();
}
if (IsPay)
if (IsPay == 1)
{
return JsonConvert.DeserializeObject<List<CourseImageModel>>(Image);
}
......
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