From 8ac8d073f62e42e5d6405b8e6ddf5a03052a9ee5 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 19 Jun 2024 13:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=B6=E9=93=B6=E5=8F=B0?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=AC=BE=E6=94=AF=E4=BB=98=E5=90=8E=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=A0=B8=E9=94=80=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 | 12 +++++++++++- .../controller/store_order/StoreOrderController.php | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 9b9a76d7b..a7aa59456 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -2,6 +2,7 @@ namespace app\common\logic; +use app\api\logic\order\OrderLogic; use app\common\enum\OrderEnum; use app\common\enum\PayEnum; use app\common\enum\user\UserShipEnum; @@ -124,6 +125,15 @@ class PayNotifyLogic extends BaseLogic self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS); } + if($extra && $extra['store_id']){ + $params = [ + 'verify_code'=>$order['verify_code'], + 'store_id'=>$extra['store_id'], + 'staff_id'=>$extra['staff_id'] + ]; + OrderLogic::writeOff($params); + } + // self::afterPay($order); // Redis::send('push-platform-print', ['id' => $order['id']], 60); // PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); @@ -252,10 +262,10 @@ class PayNotifyLogic extends BaseLogic $order->paid = 1; $order->pay_time = time(); $order->status = 2; - self::afterPay($order); if (!$order->save()) { throw new \Exception('订单保存出错'); } + self::afterPay($order); $cashFlowLogic = new CashFlowLogic(); $cashFlowLogic->insert($order['store_id'], $order['pay_price']); // Redis::send('push-platform-print', ['id' => $order['id']]); diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index 70d8173e4..e69c4f048 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -146,7 +146,10 @@ class StoreOrderController extends BaseAdminController switch ($pay_type) { case PayEnum::PURCHASE_FUNDS: //采购款支付 - PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $uid]); + PayNotifyLogic::handle('purchase_funds', $order['order_id'], [ + 'uid' => $uid,'store_id'=>$this->request->adminInfo['store_id'], + 'staff_id'=>$this->request->adminInfo['admin_id'] + ]); return $this->success('采购款支付成功', ['id' => $order['id']]); case PayEnum::CASH_PAY: