From 4c511d39b3909393e0339e5bd436aa512bae35b1 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Tue, 2 Jul 2024 17:44:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E9=99=A4=E5=BC=80=E6=AC=A1=E6=97=A5=E5=9B=9E=E8=B0=83=E7=9A=84?= =?UTF-8?q?=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 | 15 ++++++++++++--- .../store_order/StoreOrderController.php | 5 ++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index dc63ef3d7..e58fbfcb3 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -106,7 +106,7 @@ class PayNotifyLogic extends BaseLogic ]; self::dealGoodsLeft($checkArr, $order['uid'], $order['id']); } - if ($extra && $extra['store_id']) { + if ($extra && $extra['store_id'] && $order['reservation'] !=1) { $params = [ 'verify_code' => $order['verify_code'], 'store_id' => $extra['store_id'], @@ -208,7 +208,7 @@ class PayNotifyLogic extends BaseLogic // } // self::addUserSing($order); self::afterPay($order); - if ($extra && $extra['store_id']) { + if ($extra && $extra['store_id'] && $order['reservation'] !=1) { $params = [ 'verify_code' => $order['verify_code'], 'store_id' => $extra['store_id'], @@ -617,7 +617,7 @@ class PayNotifyLogic extends BaseLogic /** * 现金支付 */ - public static function cash_pay($orderSn) + public static function cash_pay($orderSn,$extra =[]) { $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); @@ -642,6 +642,15 @@ class PayNotifyLogic extends BaseLogic self::descStock($order['id']); } + if ($extra && $extra['store_id'] && $order['reservation'] !=1) { + $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']]); return true; diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index 03f2eaad1..3114b9795 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -228,7 +228,10 @@ class StoreOrderController extends BaseAdminController return $this->success('礼品券支付成功', ['id' => $order['id']]); case PayEnum::CASH_PAY: //现金支付 - PayNotifyLogic::handle('cash_pay', $order['order_id']); + PayNotifyLogic::handle('cash_pay', $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::WECHAT_PAY_BARCODE: From 5de3cf3a976bce18aa6f1f321ce12088cb2864a6 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Tue, 2 Jul 2024 17:48:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=B0=E9=87=91?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E7=9A=84=E7=9B=B4=E6=8E=A5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index e58fbfcb3..ee1555fc8 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -627,6 +627,9 @@ class PayNotifyLogic extends BaseLogic $order->paid = 1; $order->pay_time = time(); $order->status = 2; + if ($order['reservation'] ==1) { + $order->status = 1; + } if (!$order->save()) { throw new \Exception('订单保存出错'); }