From 3e425d97fc876d2d5e568b9cbbcf697842711b09 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 23 Jun 2024 20:12:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(PayNotifyLogic):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 392cf64cb..eb0f42696 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -395,17 +395,19 @@ class PayNotifyLogic extends BaseLogic $financeLogic->user = ['uid' => $order['uid']]; $financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::USER_ORDER_PAY, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); //用户订单支付 $financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']); - $financeLogic->out($transaction_id,$order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); - $user_number = bcmul($order['pay_price'], '0.10', 2); - $sing = [ - 'uid' => $order['uid'], - 'order_id' => $order['order_id'], - 'title' => '购买商品获得兑换券', - 'store_id' => $order['store_id'], - 'number' => $user_number, - ]; - $user_sing->save($sing); - User::where('id', $order['uid'])->inc('integral', $user_number)->update(); + $financeLogic->out($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); + if ($order['uid'] > 0) { + $user_number = bcmul($order['pay_price'], '0.10', 2); + $sing = [ + 'uid' => $order['uid'], + 'order_id' => $order['order_id'], + 'title' => '购买商品获得兑换券', + 'store_id' => $order['store_id'], + 'number' => $user_number, + ]; + $user_sing->save($sing); + User::where('id', $order['uid'])->inc('integral', $user_number)->update(); + } return false; $vipFen = 0; if ($order['uid'] > 0) { @@ -752,14 +754,13 @@ class PayNotifyLogic extends BaseLogic 'product_id' => $v['product_id'], ] )->withTrashed()->find(); - if($StoreBranchProduct){ + if ($StoreBranchProduct) { $updateData[] = [ 'id' => $StoreBranchProduct['id'], 'stock' => $StoreBranchProduct['stock'] - $v['cart_num'], 'sales' => ['inc', $v['cart_num']] ]; } - } (new StoreBranchProduct())->saveAll($updateData);