Commit f7b33e27 authored by liudong1993's avatar liudong1993

商品详情处理

parent b39851ca
......@@ -1260,6 +1260,7 @@ namespace Mall.Module.Product
#region 最高返佣
model.MaxShare = 0;
decimal MyBuyCommission = 0;//自购返利
var BasicsModel = distributor_BasicsRepository.GetList(new RB_Distributor_Basics_Extend() { TenantId = TenantId, MallBaseId = MallBaseId }).FirstOrDefault();
if (UserId > 0)
{
......@@ -1294,10 +1295,12 @@ namespace Mall.Module.Product
if (FXModel.DecimalType == 1)
{
model.MaxShare = Math.Ceiling(dcModel.Commission * CRate / 100);
MyBuyCommission = Math.Ceiling(dcModel.Commission * (FXModel.CommissionRatio ?? 0) / 100);
}
else
{
model.MaxShare = Math.Ceiling(dcModel.Commission * CRate) / 100;
MyBuyCommission = Math.Ceiling(dcModel.Commission * (FXModel.CommissionRatio ?? 0)) / 100;
}
}
}
......@@ -1308,10 +1311,12 @@ namespace Mall.Module.Product
if (FXModel.DecimalType == 1)
{
model.MaxShare = Math.Ceiling(model.Commission * CRate / 100);
MyBuyCommission = Math.Ceiling(model.Commission * (FXModel.CommissionRatio ?? 0) / 100);
}
else
{
model.MaxShare = Math.Ceiling(model.Commission * CRate) / 100;
MyBuyCommission = Math.Ceiling(model.Commission * (FXModel.CommissionRatio ?? 0)) / 100;
}
}
}
......@@ -1462,7 +1467,7 @@ namespace Mall.Module.Product
{
if (model.SpecificationPriceList.Any() && model.SpecificationList.Any())
{
foreach (var item in model.SpecificationPriceList)
foreach (var item in model.SpecificationPriceList.Where(x => x.SellingPrice > 0))
{
var ssarr = item.SpecificationSort.Split(':');
int Sort = Convert.ToInt32(ssarr[0]);
......@@ -1844,6 +1849,7 @@ namespace Mall.Module.Product
pic_url = x.Path
}),
share = model.MaxShare,//分销佣金
myBuyCommission = MyBuyCommission,//粉象模式 自购返利
favorite = model.Favorite,//是否收藏
goods_marketing = new
{
......
......@@ -827,7 +827,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
if (model.SpecificationPriceList.Any() && model.SpecificationList.Any())
{
foreach (var item in model.SpecificationPriceList)
foreach (var item in model.SpecificationPriceList.Where(x => x.SellingPrice > 0))
{
var ssarr = item.SpecificationSort.Split(':');
int Sort = Convert.ToInt32(ssarr[0]);
......
......@@ -1558,7 +1558,7 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.ParamIsNull("请添加商品轮播图");
}
demodel.CarouselImage = JsonConvert.SerializeObject(demodel.CarouselImageList.Select(x => x.Path));
if ((demodel.SellingPrice ?? 0) <= 0)
if ((demodel.SellingPrice ?? 0) < 0)
{
return ApiResult.ParamIsNull("请输入售价");
}
......@@ -1650,7 +1650,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("规格价格Key有误");
}
if ((pricemodel.SellingPrice ?? 0) <= 0)
if ((pricemodel.SellingPrice ?? 0) < 0)
{
return ApiResult.ParamIsNull("请输入规格列表价格");
}
......
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