更新优惠券计算规则
This commit is contained in:
parent
ae99da1907
commit
7477dda308
@ -39,7 +39,8 @@ class Settlements extends Base
|
||||
// 6,获得预获产品券为被扣税费的100% buyerPreProductInProductTaxFeeScale
|
||||
|
||||
// 购户获得预获产品券最高占产品额比例?%
|
||||
$buyerPreProductNum = round(($totalMoney + $order->deliverMoney),5);//1
|
||||
// $buyerPreProductNum = round(($totalMoney + $order->deliverMoney),5);//1
|
||||
$buyerPreProductNum = round(($discountMoney * (dataConf('couponPercentCanUsetGet')*0.01)),5);//1
|
||||
$buyerMaxCouponsNum = round(($totalMoney + $order->deliverMoney)* (dataConf('buyerPreProductInProductScale')*0.01),5);//1
|
||||
$buyerPreCoupousNum = round($discountMoney * (dataConf('buyerPreCoupousInSaleScale')*0.01),5);//2
|
||||
// $buyerPreProductNum += round($order->productHandlingFee * (dataConf('buyerPreProductInHandlingFeeScale')*0.01),2);//3
|
||||
@ -47,19 +48,11 @@ class Settlements extends Base
|
||||
// $buyerPreProductNum += round($order->couponsHandlingFee * (dataConf('buyerPreProductInProductHandlingFeeScale')*0.01),2);//5
|
||||
// $buyerPreProductNum += round($order->couponsTaxFee * (dataConf('buyerPreProductInProductTaxFeeScale')*0.01),2);//6
|
||||
$buyerPreCoupousNum = $buyerPreCoupousNum > $buyerMaxCouponsNum ? $buyerMaxCouponsNum : $buyerPreCoupousNum;
|
||||
if($buyerPreProductNum >= 0.01 || $buyerPreCoupousNum>=0.01){
|
||||
if($buyerPreProductNum > 0 || $buyerPreCoupousNum > 0){
|
||||
if(3 == $order->goodsType){
|
||||
$get_from_coupon = $discountMoney*((float)dataConf('helpSaleCouponsCalBase')/100)*((float)dataConf('couponPercentCanUsetGet')/100);
|
||||
if ($get_from_coupon > $order['goodsMoney']) {
|
||||
$get_from_coupon = $order['goodsMoney'];
|
||||
}
|
||||
Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$get_from_coupon,'交易订单【'.$order->orderNo.'】购户购物所得');
|
||||
Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$buyerPreCoupousNum*((float)dataConf('helpSaleCouponsCalBase')/100),'交易订单【'.$order->orderNo.'】购户购物所得');
|
||||
}else{
|
||||
$get_from_coupon = $discountMoney*((float)dataConf('couponPercentCanUsetGet')/100);
|
||||
if ($get_from_coupon > $order['goodsMoney']) {
|
||||
$get_from_coupon = $order['goodsMoney'];
|
||||
}
|
||||
Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$get_from_coupon,'交易订单【'.$order->orderNo.'】购户购物所得');
|
||||
Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$buyerPreCoupousNum,'交易订单【'.$order->orderNo.'】购户购物所得');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user