From 83fce9e9dd40bd2a2d67f836b359cfa3e1d2b01b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 2 Jul 2024 11:31:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BA3=E6=97=B6=E7=9A=84=E5=85=91?= =?UTF-8?q?=E6=8D=A2=E5=88=B8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 41 +++-------------------------- app/common/logic/UserSignLogic.php | 2 +- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 45f2a2a80..484f0b79f 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -96,14 +96,6 @@ class PayNotifyLogic extends BaseLogic $capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 0, $order['store_id']); self::dealProductLog($order); if ($order['shipping_type'] == 3) { - //预留收银台余额支付得兑换券逻辑 - if ($order->uid >0) { - $level = User::where('id',$order->uid)->value('user_ship'); - $discount = self::getDiscount($level); - $total_vip = bcmul($order['pay_price'], $discount, 2); - self::addNewUserSing($order,8,$total_vip,1,1); - User::where('id', $order->uid)->inc('integral', $total_vip)->update(); - } // self::descStock($order['id']); } self::afterPay($order); @@ -154,18 +146,18 @@ class PayNotifyLogic extends BaseLogic $user->integral = bcsub($user['integral'], $order['pay_price'], 2); $user->save(); //入礼品券表扣款记录 - $sing[] = [ + $sing = [ 'uid' => $order['uid'], 'order_id' => $order['order_id'], // 'title' => '订单扣除兑换券', 'title' => 5, 'financial_pm' => 0, + 'status' => 1, 'store_id' => $order['store_id'], 'number' => $order['pay_price'], - 'type' => 1, 'user_ship' => $user['user_ship'], ]; - (new UserSign())->saveAll($sing); + UserSign::create($sing); if ($extra && $extra['store_id']) { $params = [ @@ -744,24 +736,6 @@ class PayNotifyLogic extends BaseLogic if ($order['shipping_type'] == 3) { self::descStock($order['id']); - //直接加到礼品券中 - $user_sing = new UserSign(); - $level = User::where('id',$order['uid'])->value('user_ship'); - $discount = self::getDiscount($level); - $total_vip = bcmul($order['pay_price'], $discount, 2); - $sing[] = [ - 'uid' => $order['uid'], - 'order_id' => $order['order_id'], - 'title' => 8, - 'financial_pm' => 1, - 'store_id' => $order['store_id'], - 'type' => 1, - 'status' => 1, - 'number' => $total_vip, - 'back_num' => $total_vip, - ]; - $user_sing->saveAll($sing); - User::where('id', $order->uid)->inc('integral', $total_vip)->update(); } @@ -800,15 +774,6 @@ class PayNotifyLogic extends BaseLogic self::dealProductLog($order); if ($order['shipping_type'] == 3) { self::descStock($order['id']); - //直接加兑换券到对应得账户 - if ($order->uid >0) { - $level = User::where('id',$order['uid'])->value('user_ship'); - $discount = self::getDiscount($level); - $total_vip = bcmul($order['pay_price'], $discount, 2); - self::addNewUserSing($order,8,$total_vip,1,1); - User::where('id', $order->uid)->inc('integral', $total_vip)->update(); - } - } // if ($order->pay_type == 9) { diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index 9c12a7a70..dfcbf4c76 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -38,7 +38,7 @@ class UserSignLogic extends BaseLogic */ public static function OrderWrite($order) { - $total_vip = bcmul($order['price'], 0.1, 2); + $total_vip = bcmul($order['pay_price'], 0.1, 2); //非收银台订单冻结里礼品卷 if ($order['source'] == 0) {