From b63052f6047135e818028d851398e960cd9368c4 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 29 Jun 2024 16:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=97=A5=E5=BF=97=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index adcef5d72..b7edff3d2 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -404,6 +404,13 @@ class PayNotifyLogic extends BaseLogic self::dealProductLog($order); if ($order['shipping_type'] == 3) { self::descStock($order['id']); + //直接加对应兑换券 + if ($order->uid >0) { + $total_vip = bcmul($order['pay_price'], 0.1, 2); + self::addNewUserSing($order,8,$total_vip,1,1); + User::where('id', $order->uid)->inc('integral', $total_vip)->update(); + } + } if (!empty($extra['payer']['openid']) && $order->pay_type == 7) { Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid']], 4); @@ -811,6 +818,13 @@ class PayNotifyLogic extends BaseLogic self::dealProductLog($order); if ($order['shipping_type'] == 3) { self::descStock($order['id']); + //直接加兑换券到对应得账户 + if ($order->uid >0) { + $total_vip = bcmul($order['pay_price'], 0.1, 2); + self::addNewUserSing($order,8,$total_vip,1,1); + User::where('id', $order->uid)->inc('integral', $total_vip)->update(); + } + } // if ($order->pay_type == 9) { @@ -848,7 +862,7 @@ class PayNotifyLogic extends BaseLogic $user_ship = User::where('id', $order['uid'])->value('user_ship'); //会员不加兑换券 if ( $order['uid'] > 0 && $order['total_price'] >= 500 - && $order['pay_type'] != PayEnum::PURCHASE_FUNDS && $user_ship != 1 + && $order['pay_type'] != PayEnum::PURCHASE_FUNDS && $user_ship != 1 && $order['shipping_type'] !=3 ) { $user_number = bcmul($order['pay_price'], '0.10', 2); $sing = [ @@ -871,7 +885,8 @@ class PayNotifyLogic extends BaseLogic //用户下单该用户等级为1得时候才处理冻结金额 $user = User::where('id', $order['uid'])->find(); $user_ship = $user['user_ship']; - if($order['total_price'] >= 500 && $order['pay_type'] !=PayEnum::PURCHASE_FUNDS && $user_ship !=1){ + if($order['total_price'] >= 500 && $order['pay_type'] !=PayEnum::PURCHASE_FUNDS && $user_ship !=1 + && $order['shipping_type'] !=3){ $user_number = bcmul($order['pay_price'], '0.10', 2); $sing = [ 'uid' => $order['uid'],