精度5位
This commit is contained in:
parent
a6ce52eef7
commit
425f003747
@ -24,7 +24,7 @@ class Settlements extends Base
|
||||
//$discountMoney += ($v['goodsPrice']*$v['goodsNum'] + $v['freight']) * ($v['discountRate']*0.01);//优惠款
|
||||
$discountMoney += ($v['goodsPrice']*$v['goodsNum']) * ($v['discountRate']*0.01);//优惠款
|
||||
}
|
||||
$discountMoney = round($discountMoney,2);
|
||||
$discountMoney = round($discountMoney,5);
|
||||
//加入快代付值
|
||||
Model('SysSummary')->addToPayFast($orderId,$discountMoney,'订单【'.($order['orderNo']?:'--').'】优惠款加入');
|
||||
//获取产品额
|
||||
@ -39,9 +39,9 @@ class Settlements extends Base
|
||||
// 6,获得预获产品券为被扣税费的100% buyerPreProductInProductTaxFeeScale
|
||||
|
||||
// 购户获得预获产品券最高占产品额比例?%
|
||||
$buyerPreProductNum = round(($totalMoney + $order->deliverMoney),2);//1
|
||||
$buyerMaxCouponsNum = round(($totalMoney + $order->deliverMoney)* (dataConf('buyerPreProductInProductScale')*0.01),2);//1
|
||||
$buyerPreCoupousNum = round($discountMoney * (dataConf('buyerPreCoupousInSaleScale')*0.01),2);//2
|
||||
$buyerPreProductNum = round(($totalMoney + $order->deliverMoney),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
|
||||
// $buyerPreProductNum += round($order->productTaxFee * (dataConf('buyerPreProductInTaxFeeScale')*0.01),2);//4
|
||||
// $buyerPreProductNum += round($order->couponsHandlingFee * (dataConf('buyerPreProductInProductHandlingFeeScale')*0.01),2);//5
|
||||
@ -62,8 +62,8 @@ class Settlements extends Base
|
||||
// 2,商户获得预获优惠券占优惠款比例 100% sellerPreCoupousInSaleScale
|
||||
// 3,优惠款-产品-优惠券-旺旺券,大于0是商户需付公司的钱,小于0是公司需付给商户的钱,即旺旺券
|
||||
// $discountMoney-$order->productNum-$order->couponsNum-$order->wangNum-$order->moneyNum
|
||||
$sellerPreProductNum = round($discountMoney * (dataConf('sellerPreProductInProductScale')*0.01),2);//1
|
||||
$sellerPreCoupousNum = round($discountMoney * (dataConf('sellerPreCoupousInSaleScale')*0.01),2);//2
|
||||
$sellerPreProductNum = round($discountMoney * (dataConf('sellerPreProductInProductScale')*0.01),5);//1
|
||||
$sellerPreCoupousNum = round($discountMoney * (dataConf('sellerPreCoupousInSaleScale')*0.01),5);//2
|
||||
$calBaseNum = Db::table("__ORDERS__ o")->join("__ORDER_GOODS__ g", "g.orderId=o.orderId", 'inner')
|
||||
->where(['o.orderId'=>$orderId])->sum('g.goodsPrice*g.goodsNum*g.discountRate*0.01');
|
||||
if($sellerPreProductNum >= 0.01 || $sellerPreCoupousNum>=0.01){
|
||||
@ -120,7 +120,7 @@ class Settlements extends Base
|
||||
|
||||
//旺旺券结算
|
||||
$payVouchersNum = ($order->productNum - $order->productHandlingFee - $order->productTaxFee) + ($order->couponsNum - $order->couponsHandlingFee - $order->couponsTaxFee) + $order->wangNum;////3个券的付款总额+$order->moneyNum;
|
||||
$giveWangNum = round($payVouchersNum - $discountMoney,2);
|
||||
$giveWangNum = round($payVouchersNum - $discountMoney,5);
|
||||
$m->setTable('orders');
|
||||
if($giveWangNum > 0){
|
||||
$m->updateInfo(['orderId'=>$orderId],['certificateStatus'=>1,'payable'=>$giveWangNum]);
|
||||
@ -143,9 +143,9 @@ class Settlements extends Base
|
||||
$yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($agentUserId,'realTotalMoney');
|
||||
$agentProductMoney = 0;
|
||||
if($yesterdayBuyMoney >= dataConf('shopPreCoupousYdGTMoney')){//大于设定值
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousYesInProductScale')*0.01),2);//1
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousYesInProductScale')*0.01),5);//1
|
||||
}else{
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousNoInProductScale')*0.01),2);//2
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousNoInProductScale')*0.01),5);//2
|
||||
}
|
||||
if($agentProductMoney >= 0.01){
|
||||
Model('common/UserVouchers')->insertVouchersNotice($agentUserId,$orderId,0,$agentProductMoney,'交易订单【'.$order->orderNo.'】商超所得');
|
||||
@ -160,9 +160,9 @@ class Settlements extends Base
|
||||
$yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($agentUserId,'realTotalMoney');
|
||||
$agentProductMoney = 0;
|
||||
if($yesterdayBuyMoney >= dataConf('shopPreCoupousYdGTMoney')){//大于设定值
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousYesInProductScale')*0.01),2);//1
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousYesInProductScale')*0.01),5);//1
|
||||
}else{
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousNoInProductScale')*0.01),2);//2
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousNoInProductScale')*0.01),5);//2
|
||||
}
|
||||
if($agentProductMoney >= 0.01){
|
||||
Model('common/UserVouchers')->insertVouchersNotice($agentUserId,$orderId,0,$agentProductMoney,'交易订单【'.$order->orderNo.'】商厦所得');
|
||||
@ -176,9 +176,9 @@ class Settlements extends Base
|
||||
$yesterdayBuyMoney = Model('common/Orders')->getYesterdayBuyMoney($agentUserId,'realTotalMoney');
|
||||
$agentProductMoney = 0;
|
||||
if($yesterdayBuyMoney >= dataConf('shopPreCoupousYdGTMoney')){//大于设定值
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousYesInProductScale')*0.01),2);//1
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousYesInProductScale')*0.01),5);//1
|
||||
}else{
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousNoInProductScale')*0.01),2);//2
|
||||
$agentProductMoney = round($totalMoney * (dataConf('shopPreCoupousNoInProductScale')*0.01),5);//2
|
||||
}
|
||||
if($agentProductMoney >= 0.01){
|
||||
Model('common/UserVouchers')->insertVouchersNotice($agentUserId,$orderId,0,$agentProductMoney,'交易订单【'.$order->orderNo.'】商都所得');
|
||||
|
Loading…
x
Reference in New Issue
Block a user