Commit eb5b41b2 authored by liudong1993's avatar liudong1993

Merge branch 'sdzq' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 08c56eec a41fb90b
......@@ -1846,9 +1846,9 @@ namespace Mall.Module.Product
title = Integral > 0 ? "购买可得" + Integral + "积分" : ""
},
commentIntegral = new
{
title = CommentIntegral > 0 ? "购买并评论可得" + Integral + "积分" : ""
}
{
title = CommentIntegral > 0 ? "购买并评论可得" + Integral + "积分" : ""
}
},
extra_quick_share = new
{
......@@ -2014,7 +2014,8 @@ namespace Mall.Module.Product
{
continue;
}
if (gmodel.CarType != GuideCarGoodsTypeEnum.Line) {
if (gmodel.CarType != GuideCarGoodsTypeEnum.Line)
{
item.Number = 1;//s设置成一个人表示一口价 保险费算人头数
}
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
......@@ -3948,7 +3949,14 @@ namespace Mall.Module.Product
item.CommentList = new List<RB_Goods_Comment_Extend>();
item.CommentList.AddRange(carCommentList.Where(x => x.OrderDetailId == item.OrderDetailId));
item.CommentList.AddRange(guideCommentList.Where(x => x.OrderDetailId == item.OrderDetailId));
if (item.UserId > 0)
{
item.UserPhotoPath = userList.Where(x => x.Id == item.UserId).FirstOrDefault()?.Photo ?? "";
}
if (item.UserId == 0 && item.UserPhoto > 0)
{
item.UserPhotoPath = material_InfoRepository.GetEntity(item.UserPhoto)?.Path ?? "";
}
foreach (var itemComment in item.CommentList)
{
itemComment.CommentImgList = new List<string>();
......@@ -3957,14 +3965,7 @@ namespace Mall.Module.Product
{
itemComment.CommentImgList = JsonConvert.DeserializeObject<List<string>>(itemComment.CommentImage);
}
if (item.UserId > 0)
{
itemComment.UserPhotoPath = userList.Where(x => x.Id == item.UserId).FirstOrDefault()?.Photo ?? "";
}
if (itemComment.UserId == 0 && itemComment.UserPhoto > 0)
{
itemComment.UserPhotoPath = material_InfoRepository.GetEntity(item.UserPhoto)?.Path ?? "";
}
}
}
......@@ -4028,7 +4029,32 @@ namespace Mall.Module.Product
{
if (memberIntegralModel.Id == 0)
{
return member_IntegralRepository.Insert(memberIntegralModel) > 0;
bool result = member_IntegralRepository.Insert(memberIntegralModel) > 0;
if (result && memberIntegralModel.UserId > 0)//更新当前用户的积分
{
try
{
var memberUserModel = member_UserRepository.GetEntity(memberIntegralModel.UserId);
memberUserModel.Integral += (memberIntegralModel.Integral ?? 0);
//更新订单商品为已评价
Dictionary<string, object> keyValuesCar = new Dictionary<string, object>() {
{ nameof(RB_Member_User.Integral),memberUserModel.Integral}
};
List<WhereHelper> wheresCar = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Member_User.Id),
FiledValue=memberIntegralModel.UserId,
OperatorEnum=OperatorEnum.Equal
}
};
member_UserRepository.Update(keyValuesCar, wheresCar);
}
catch (Exception ex)
{
LogHelper.Write(ex);
}
}
return result;
}
return false;
......
......@@ -12830,10 +12830,34 @@ namespace Mall.Module.Product
/// <returns></returns>
public bool AddMemberIntegral(Model.Entity.User.RB_Member_Integral memberIntegralModel)
{
if (memberIntegralModel.Id == 0)
{
return member_IntegralRepository.Insert(memberIntegralModel) > 0;
bool result = member_IntegralRepository.Insert(memberIntegralModel) > 0;
if (result && memberIntegralModel.UserId > 0)//更新当前用户的积分
{
try
{
var memberUserModel = member_UserRepository.GetEntity(memberIntegralModel.UserId);
memberUserModel.Integral += (memberIntegralModel.Integral ?? 0);
//更新订单商品为已评价
Dictionary<string, object> keyValuesCar = new Dictionary<string, object>() {
{ nameof(Model.Entity.User.RB_Member_User.Integral),memberUserModel.Integral}
};
List<WhereHelper> wheresCar = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(Model.Entity.User.RB_Member_User.Id),
FiledValue=memberIntegralModel.UserId,
OperatorEnum=OperatorEnum.Equal
}
};
member_UserRepository.Update(keyValuesCar, wheresCar);
}
catch (Exception ex)
{
LogHelper.Write(ex);
}
}
return result;
}
return false;
......
......@@ -4522,7 +4522,7 @@ namespace Mall.Module.User
WaitSendGoods = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
GuideCarWaitCommentNum,
Completed = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.Completed).FirstOrDefault()?.OrderNum ?? 0,
Completed = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.Received).FirstOrDefault()?.OrderNum ?? 0,
},
isShowDistributionCenter = IsShowDistributionCenter
};
......
......@@ -297,7 +297,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
whereGrade += $@" and t.TotalScore>=1 and t.TotalScore<=3";
}
}
string sql = $@" SELECT * from(SELECT OrderDetailId,UserId,UserPhoto,Is_Anonymity,SUM(CommentScore) AS TotalScore,GoodsId,DATE_FORMAT(UpdateDate, '%y-%m-%d') AS UpdateDate ,
string sql = $@" SELECT * from(SELECT OrderDetailId,UserName,UserId,UserPhoto,Is_Anonymity,SUM(CommentScore) AS TotalScore,GoodsId,DATE_FORMAT(UpdateDate, '%y-%m-%d') AS UpdateDate ,
case
when SUM(CommentScore)<=3 then 3
when SUM(CommentScore)>3 and SUM(CommentScore)<=6 then 2
......
......@@ -128,25 +128,29 @@ namespace Mall.WebApi.Controllers.Product
DateTime tempStartTime = Convert.ToDateTime(demodel.StartTime);
DateTime tempEndTime = Convert.ToDateTime(demodel.EndTime);
if (tempStartTime.ToString("yyyy-MM-dd") == tempEndTime.ToString("yyyy-MM-dd"))//判断使用天数是否是0.5天/1天
if (demodel.CarType.HasValue && (demodel.CarType == Common.Enum.Goods.GuideCarGoodsTypeEnum.JJ || demodel.CarType == Common.Enum.Goods.GuideCarGoodsTypeEnum.SJ))
{
TimeSpan sp = tempEndTime.Subtract(tempStartTime);
if (sp.Hours > 6)
demodel.UseDay = 1;
}
else {
if (tempStartTime.ToString("yyyy-MM-dd") == tempEndTime.ToString("yyyy-MM-dd"))//判断使用天数是否是0.5天/1天
{
demodel.UseDay = 1;
TimeSpan sp = tempEndTime.Subtract(tempStartTime);
if (sp.Hours > 6)
{
demodel.UseDay = 1;
}
else
{
demodel.UseDay = Convert.ToDecimal(0.5);
}
}
else
{
demodel.UseDay = Convert.ToDecimal(0.5);
TimeSpan sp = tempEndTime.Date.Subtract(tempStartTime.Date);
demodel.UseDay = sp.Days + 1;
}
}
else
{
TimeSpan sp = tempEndTime.Date.Subtract(tempStartTime.Date);
demodel.UseDay = sp.Days + 1;
}
var list = guideCarModule.GetAppletGuidCarPageListForCar(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
List<object> RList = new List<object>();
......
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