mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:03:27 +08:00
【优化】调整如果售后为0的情况下,积分策略
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"> </label>
|
||||
|
||||
Reference in New Issue
Block a user