From ba9bc4a8aab3a450f84a0131fcad316e53b40bbb Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Mon, 24 Jun 2024 17:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=85=85=E5=80=BC=E9=80=80?= =?UTF-8?q?=E6=AC=BE=E9=80=BB=E8=BE=91=E5=92=8C=E8=AE=A2=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user_recharge/UserRechargeController.php | 2 +- app/api/controller/PayController.php | 2 -- app/common/logic/PayNotifyLogic.php | 11 +++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/admin/controller/user_recharge/UserRechargeController.php b/app/admin/controller/user_recharge/UserRechargeController.php index f583a2e5..afb5bb4f 100644 --- a/app/admin/controller/user_recharge/UserRechargeController.php +++ b/app/admin/controller/user_recharge/UserRechargeController.php @@ -114,7 +114,7 @@ class UserRechargeController extends BaseAdminController } //支付宝 - + return $this->success(); } diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index 6b5d5ff9..37bd0d97 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -28,8 +28,6 @@ class PayController extends BaseApiController { $app = new PayService(1); $result = $app->wechat->callback(Request()->post()); - Cache::set('6log'.time(),$result); - Cache::set('6logJ'.time(),json_encode($result)); if ($result && $result->event_type == 'TRANSACTION.SUCCESS') { $ciphertext = $result->resource['ciphertext']; if ($ciphertext['trade_state'] === 'SUCCESS') { diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index f9877d6d..54b7076d 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -259,6 +259,17 @@ class PayNotifyLogic extends BaseLogic //更新状态 $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); if ($order->isEmpty() || $order->status == OrderEnum::REFUND_PAY) { + //充值 + $orderRe = UserRecharge::where('order_id',$orderSn)->findOrEmpty(); + if($orderRe->isEmpty() || $orderRe->status == -1){ + return true; + } + $orderRe->status = -1; + $orderRe->refund_price = $orderRe->price; + $orderRe->refund_time = time(); + $orderRe->remarks = ''; + $orderRe->save(); + return true; } $order->status = OrderEnum::REFUND_PAY;