From 14107b2da6af1f2c7ffd06d455a9162fcc5b8cad Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 19 Oct 2020 19:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/common/model/Orders.php | 23 ----------------------- hyhproject/common/model/Settlements.php | 12 ++++++++++-- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/hyhproject/common/model/Orders.php b/hyhproject/common/model/Orders.php index 5c7e62c..f5d07c0 100755 --- a/hyhproject/common/model/Orders.php +++ b/hyhproject/common/model/Orders.php @@ -1502,13 +1502,6 @@ class Orders extends Base{ }else{ $m->insertInfo(['userId'=>$userId,'ectNum'=>$order['realTotalMoney'],'ectType'=>1,'dataRemarks'=>'购户购物']); } - $vm = new UserVouchers(); - $get_from_coupon = $calBaseNum*((float)dataConf('couponPercentCanUsetGet')/100); - if ($get_from_coupon > $order['goodsMoney']) { - $get_from_coupon = $order['goodsMoney']; - } - $vm->insertVouchersNotice($userId, $orderId, $get_from_coupon, 0, - '交易订单【'.$order['orderNo'].'】购户从优惠款中获得',1); } elseif (3 == $order['goodsType']){//助购吧购物 @@ -1580,22 +1573,6 @@ class Orders extends Base{ "helpGetCount2"=>$calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), ]); } - - $get_from_coupon = $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100)*((float)dataConf('couponPercentCanUsetGet')/100); - if ($get_from_coupon > $order['goodsMoney']) { - $get_from_coupon = $order['goodsMoney']; - } - $vm->insertVouchersNotice($userId, $orderId, $get_from_coupon, 0, - '交易订单【'.$order['orderNo'].'】购户从优惠款中获得',1); - } - elseif (1 == $order['goodsType']) { - $vm = new UserVouchers(); - $get_from_coupon = $calBaseNum*((float)dataConf('couponPercentCanUsetGet')/100); - if ($get_from_coupon > $order['goodsMoney']) { - $get_from_coupon = $order['goodsMoney']; - } - $vm->insertVouchersNotice($userId, $orderId, $get_from_coupon, 0, - '交易订单【'.$order['orderNo'].'】购户从优惠款中获得',1); } //新增订单日志 diff --git a/hyhproject/common/model/Settlements.php b/hyhproject/common/model/Settlements.php index 62a2529..408184a 100755 --- a/hyhproject/common/model/Settlements.php +++ b/hyhproject/common/model/Settlements.php @@ -49,9 +49,17 @@ class Settlements extends Base $buyerPreCoupousNum = $buyerPreCoupousNum > $buyerMaxCouponsNum ? $buyerMaxCouponsNum : $buyerPreCoupousNum; if($buyerPreProductNum >= 0.01 || $buyerPreCoupousNum>=0.01){ if(3 == $order->goodsType){ - Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$buyerPreCoupousNum*((float)dataConf('helpSaleCouponsCalBase')/100),'交易订单【'.$order->orderNo.'】购户购物所得'); + $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.'】购户购物所得'); }else{ - Model('common/UserVouchers')->insertVouchersNotice($order->userId,$orderId,$buyerPreProductNum,$buyerPreCoupousNum,'交易订单【'.$order->orderNo.'】购户购物所得'); + $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.'】购户购物所得'); } } }