【优化】调整如果售后为0的情况下,积分策略

This commit is contained in:
大灰灰
2022-08-19 01:08:51 +08:00
parent 4e7f4ab1d9
commit 240197f3e6
2 changed files with 28 additions and 7 deletions

View File

@@ -100,16 +100,37 @@ namespace CoreCms.Net.RedisMQ.Subscribe
if (pointExchangeModel == 1)
{
//可能存在就是根本不是全积分抵扣,而是订单实际在不够积分的情况下,抵扣了多少金额。那么统一就根据订单的比例来计算,更加精准,(这里的总金额是实际支付金额,去掉了优惠)
var practicalProportion = Math.Round(order.pointMoney / order.orderAmount, 4);
//如果订单实际支付金额是0的话那就是全积分。
var practicalProportion = order.orderAmount <= 0 ? 1 : Math.Round(order.pointMoney / order.orderAmount, 4);
//未发货的商品库存调整,如果订单未发货或者部分发货,并且用户未收到商品的情况下,需要解冻冻结库存
if ((order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.No ||
order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.PartialYes) &&
info.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund && p.nums == 0)
{
point += aftersalesProduct.price * practicalProportion * pointDiscountedProportion;
}
else
{
//获取货品金额*积分使用比例*数量*积分折现比例=积分抵扣的金额应该可以兑换的积分。
point += aftersalesProduct.price * practicalProportion * p.nums * pointDiscountedProportion;
}
//获取货品金额*积分使用比例*数量*积分折现比例=积分抵扣的金额应该可以兑换的积分。
point += aftersalesProduct.price * practicalProportion * p.nums * pointDiscountedProportion;
}
//如果是单品模式
else if (pointExchangeModel == 2)
{
//单品模式只能是全积分抵扣或者全金额支付。所以直接按照扣掉的金额还原积分即可。
point += aftersalesProduct.pointsDeduction * p.nums * pointDiscountedProportion;
if ((order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.No ||
order.shipStatus == (int)GlobalEnumVars.OrderShipStatus.PartialYes) &&
info.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund && p.nums == 0)
{
point += aftersalesProduct.pointsDeduction * pointDiscountedProportion;
}
else
{
//单品模式只能是全积分抵扣或者全金额支付。所以直接按照扣掉的金额还原积分即可。
point += aftersalesProduct.pointsDeduction * p.nums * pointDiscountedProportion;
}
}
}

View File

@@ -253,9 +253,9 @@
<div class="layui-form-item" style="margin-top: 20px;">
<label class="layui-form-label">{{d.data.configs['shopMobile']['sKey']}}</label>
<div class="layui-input-inline layui-inline-5">
<input type="text" name="shopMobile" value="{{d.data.configs['shopMobile']['sValue']}}" lay-verify="title|phone" autocomplete="off" placeholder="请输入接收通知手机号" class="layui-input">
<input type="text" name="shopMobile" value="{{d.data.configs['shopMobile']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="请输入接收通知手机号" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">前台下单时给商家发送短信通知</div>
<div class="layui-form-mid layui-word-aux">前台下单时给商家发送短信通知多个手机号请使用小写逗号,隔开最多8个号码19145919666,19145919666</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">&nbsp;</label>