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
...@@ -2014,7 +2014,8 @@ namespace Mall.Module.Product ...@@ -2014,7 +2014,8 @@ namespace Mall.Module.Product
{ {
continue; continue;
} }
if (gmodel.CarType != GuideCarGoodsTypeEnum.Line) { if (gmodel.CarType != GuideCarGoodsTypeEnum.Line)
{
item.Number = 1;//s设置成一个人表示一口价 保险费算人头数 item.Number = 1;//s设置成一个人表示一口价 保险费算人头数
} }
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList(); var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
...@@ -3948,7 +3949,14 @@ namespace Mall.Module.Product ...@@ -3948,7 +3949,14 @@ namespace Mall.Module.Product
item.CommentList = new List<RB_Goods_Comment_Extend>(); item.CommentList = new List<RB_Goods_Comment_Extend>();
item.CommentList.AddRange(carCommentList.Where(x => x.OrderDetailId == item.OrderDetailId)); item.CommentList.AddRange(carCommentList.Where(x => x.OrderDetailId == item.OrderDetailId));
item.CommentList.AddRange(guideCommentList.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) foreach (var itemComment in item.CommentList)
{ {
itemComment.CommentImgList = new List<string>(); itemComment.CommentImgList = new List<string>();
...@@ -3957,14 +3965,7 @@ namespace Mall.Module.Product ...@@ -3957,14 +3965,7 @@ namespace Mall.Module.Product
{ {
itemComment.CommentImgList = JsonConvert.DeserializeObject<List<string>>(itemComment.CommentImage); 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 ...@@ -4028,7 +4029,32 @@ namespace Mall.Module.Product
{ {
if (memberIntegralModel.Id == 0) 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; return false;
......
...@@ -12830,10 +12830,34 @@ namespace Mall.Module.Product ...@@ -12830,10 +12830,34 @@ namespace Mall.Module.Product
/// <returns></returns> /// <returns></returns>
public bool AddMemberIntegral(Model.Entity.User.RB_Member_Integral memberIntegralModel) public bool AddMemberIntegral(Model.Entity.User.RB_Member_Integral memberIntegralModel)
{ {
if (memberIntegralModel.Id == 0) 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; return false;
......
...@@ -4522,7 +4522,7 @@ namespace Mall.Module.User ...@@ -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, 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, WaitReceiving = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
GuideCarWaitCommentNum, 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 isShowDistributionCenter = IsShowDistributionCenter
}; };
......
...@@ -297,7 +297,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} "; ...@@ -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"; 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 case
when SUM(CommentScore)<=3 then 3 when SUM(CommentScore)<=3 then 3
when SUM(CommentScore)>3 and SUM(CommentScore)<=6 then 2 when SUM(CommentScore)>3 and SUM(CommentScore)<=6 then 2
......
...@@ -128,6 +128,11 @@ namespace Mall.WebApi.Controllers.Product ...@@ -128,6 +128,11 @@ namespace Mall.WebApi.Controllers.Product
DateTime tempStartTime = Convert.ToDateTime(demodel.StartTime); DateTime tempStartTime = Convert.ToDateTime(demodel.StartTime);
DateTime tempEndTime = Convert.ToDateTime(demodel.EndTime); DateTime tempEndTime = Convert.ToDateTime(demodel.EndTime);
if (demodel.CarType.HasValue && (demodel.CarType == Common.Enum.Goods.GuideCarGoodsTypeEnum.JJ || demodel.CarType == Common.Enum.Goods.GuideCarGoodsTypeEnum.SJ))
{
demodel.UseDay = 1;
}
else {
if (tempStartTime.ToString("yyyy-MM-dd") == tempEndTime.ToString("yyyy-MM-dd"))//判断使用天数是否是0.5天/1天 if (tempStartTime.ToString("yyyy-MM-dd") == tempEndTime.ToString("yyyy-MM-dd"))//判断使用天数是否是0.5天/1天
{ {
TimeSpan sp = tempEndTime.Subtract(tempStartTime); TimeSpan sp = tempEndTime.Subtract(tempStartTime);
...@@ -145,8 +150,7 @@ namespace Mall.WebApi.Controllers.Product ...@@ -145,8 +150,7 @@ namespace Mall.WebApi.Controllers.Product
TimeSpan sp = tempEndTime.Date.Subtract(tempStartTime.Date); TimeSpan sp = tempEndTime.Date.Subtract(tempStartTime.Date);
demodel.UseDay = sp.Days + 1; demodel.UseDay = sp.Days + 1;
} }
}
var list = guideCarModule.GetAppletGuidCarPageListForCar(pagelist.pageIndex, pagelist.pageSize, out long count, demodel); var list = guideCarModule.GetAppletGuidCarPageListForCar(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
List<object> RList = new List<object>(); 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