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.'】购户购物所得'); } } }