From 88d8a22241ac6a6f89d9aad6d943773c4572c018 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 27 Jun 2024 09:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E5=BA=97=E4=BD=99=E9=A2=9D=E6=B6=88?= =?UTF-8?q?=E8=B4=B9=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 12 ++++++++++-- .../store_order/StoreOrderController.php | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index efa099861..005c32207 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -96,6 +96,14 @@ class PayNotifyLogic extends BaseLogic self::descStock($order['id']); } self::afterPay($order); + if ($extra && $extra['store_id']) { + $params = [ + 'verify_code' => $order['verify_code'], + 'store_id' => $extra['store_id'], + 'staff_id' => $extra['staff_id'] + ]; + OrderLogic::writeOff($params); + } // Redis::send('push-platform-print', ['id' => $order['id']], 60); // PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); } @@ -186,6 +194,7 @@ class PayNotifyLogic extends BaseLogic // self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS); // } // self::addUserSing($order); + self::afterPay($order); if ($extra && $extra['store_id']) { $params = [ 'verify_code' => $order['verify_code'], @@ -199,7 +208,7 @@ class PayNotifyLogic extends BaseLogic // self::descStock($order['id']); // } - 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' => '您有一笔新的订单']); } @@ -357,7 +366,6 @@ class PayNotifyLogic extends BaseLogic //日志记录 $model = new StoreCashFinanceFlow(); $model->store_id = $order['store_id'] ?? 0; - $model->store_id = $order['store_id'] ?? 0; $model->cash_price = $order->pay_price; $model->receivable = $order->pay_price; $model->remark = '退款'; diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index 1b14fec01..c17809179 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -174,6 +174,13 @@ class StoreOrderController extends BaseAdminController $order = OrderLogic::createOrder($cartId, $addressId, $user, $params); if ($order != false) { switch ($pay_type) { + case PayEnum::BALANCE_PAY: + //余额支付 + PayNotifyLogic::handle('balancePay', $order['order_id'],[ + 'store_id' => $this->request->adminInfo['store_id'], + 'staff_id' => $this->request->adminInfo['admin_id'] + ]); + return $this->success('余额支付成功'); case PayEnum::PURCHASE_FUNDS: //采购款支付 PayNotifyLogic::handle('purchase_funds', $order['order_id'], [ @@ -248,9 +255,17 @@ class StoreOrderController extends BaseAdminController return $this->fail('订单不存在或已支付'); } switch ($pay_type) { + case PayEnum::BALANCE_PAY: + //余额支付 + PayNotifyLogic::handle('balancePay', $order['order_id'],[ + 'store_id' => $this->request->adminInfo['store_id'], + 'staff_id' => $this->request->adminInfo['admin_id'] + ]); + return $this->success('余额支付成功'); case PayEnum::PURCHASE_FUNDS: //采购款支付 - PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $order['uid']]); + PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $order['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: //现金支付