From 70f60d11dfe8cd89b0512d189c51c2ee5990af6f Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 3 Dec 2020 16:26:12 +0800 Subject: [PATCH] =?UTF-8?q?36=E5=85=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/common/model/Orders.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hyhproject/common/model/Orders.php b/hyhproject/common/model/Orders.php index 6f4a81b..3f6fccc 100755 --- a/hyhproject/common/model/Orders.php +++ b/hyhproject/common/model/Orders.php @@ -1547,15 +1547,19 @@ class Orders extends Base{ '预获产品券转换所扣', 0); } + // 20201203预获产品券 * 层数*基数 + $buyerPreProductNum = round(($calBaseNum * (dataConf('couponPercentCanUsetGet')*0.01)),5);//1 + $totalMoney = $order['realTotalMoney'];//产品额 + $buyerPreProductNum = $buyerPreProductNum > $totalMoney ? $totalMoney : $buyerPreProductNum; // 10.15添加:助购户的 助购预获 减少的同时 代快付值等额减少 if ((int)$order["helpUserLevel"] === 1) { Db::name("orders")->where(compact('orderId'))->update([ - "helpGetCount"=>$order['goodsMoney']*((int)$order["helpUserLevel"]), + "helpGetCount"=>$buyerPreProductNum, "helpGetCount2"=>$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), ]);} else { Db::name("orders")->where(compact('orderId'))->update([ - "helpGetCount"=>$order['goodsMoney']*((int)$order["helpUserLevel"])*(float)dataConf("helpSaleCalBase"), + "helpGetCount"=>$buyerPreProductNum*((int)$order["helpUserLevel"])*(float)dataConf("helpSaleCalBase"), "helpGetCount2"=>$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), ]); }