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;