diff --git a/app/admin/controller/user_recharge/UserRechargeController.php b/app/admin/controller/user_recharge/UserRechargeController.php index f583a2e56..5ef965ca6 100644 --- a/app/admin/controller/user_recharge/UserRechargeController.php +++ b/app/admin/controller/user_recharge/UserRechargeController.php @@ -95,7 +95,7 @@ class UserRechargeController extends BaseAdminController public function refund() { - $params = (new UserRechargeValidate())->goCheck('refund'); + $params = (new UserRechargeValidate())->post()->goCheck('refund'); $detail = UserRecharge::where('id',$params['id'])->findOrEmpty(); if(empty($detail)){ return $this->fail('无该充值订单请检查'); @@ -114,7 +114,11 @@ class UserRechargeController extends BaseAdminController } //支付宝 + if($detail['recharge_type'] == 'ALI_INDUSTRYMEMBERS'){ + } + + return $this->success(); } diff --git a/app/admin/lists/user_recharge/UserRechargeLists.php b/app/admin/lists/user_recharge/UserRechargeLists.php index 6a9101e65..327c2dba8 100644 --- a/app/admin/lists/user_recharge/UserRechargeLists.php +++ b/app/admin/lists/user_recharge/UserRechargeLists.php @@ -44,7 +44,7 @@ class UserRechargeLists extends BaseAdminDataLists implements ListsSearchInterfa public function lists(): array { return UserRecharge::where($this->searchWhere) - ->field(['id', 'uid', 'order_id', 'price', 'recharge_type', 'paid', 'pay_time']) + ->field(['id', 'uid', 'order_id', 'price', 'recharge_type', 'paid', 'pay_time','status','refund_time']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { @@ -54,6 +54,11 @@ class UserRechargeLists extends BaseAdminDataLists implements ListsSearchInterfa }else{ $item['pay_time']=''; } + if($item['refund_time']>0){ + $item['refund_time']=date('Y-m-d H:i:s',$item['refund_time']); + }else{ + $item['refund_time']=''; + } if($item['paid']==1){ $item['paid_name']='已充值'; }else{ diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index 6b5d5ff94..37bd0d970 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 f9877d6d3..54b7076d6 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;