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), ]); }