From 8b64213feb1f600786ffdaebeee2bc8c771510a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=8B=BC?= <2468023037@qq.com> Date: Sun, 23 Feb 2025 14:35:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/WithdrawController.php | 7 +++++-- app/model/Withdraw.php | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controller/api/WithdrawController.php b/app/controller/api/WithdrawController.php index 8520ddb..b789b60 100644 --- a/app/controller/api/WithdrawController.php +++ b/app/controller/api/WithdrawController.php @@ -129,14 +129,13 @@ class WithdrawController UserRewardDao::base($user_id, 1, - ($money_no + 300), '提现'); return ApiResponseApp::success(null, '等待管理员审核'); } + //用户积分减少$money UserRewardDao::base($user_id, 1, - ($money_no + 300), '提现'); $userbank = Userbank::where('id', $bank_id)->first(); - //获取刚刚存入数据库的id(订单号) $orderId = $withdraw->id; $res = PaymentNew::pushMoney($money, $userbank->bank_username, $userbank->account, $userbank->bank_name, $orderId); - // //逻辑错误需要修改 if ($res->Success) { $withdraw->update([ @@ -146,6 +145,10 @@ class WithdrawController ]); return ApiResponseApp::success(null, '转账成功'); } else { + $withdraw->update([ + 'status' => 5, // + 'status_text' => '支付错误:'.$res->ErrorMessage + ]); UserRewardDao::base($user_id, 1, $money_no + 300, '提现失败返还'); if ($res->ErrorMessage == "PayeeAccountNameFormatError") { return ApiResponseApp::error(null, '收款人帐号格式错误'); diff --git a/app/model/Withdraw.php b/app/model/Withdraw.php index d56a068..e44353d 100644 --- a/app/model/Withdraw.php +++ b/app/model/Withdraw.php @@ -37,5 +37,6 @@ class Withdraw extends Model 'createtime2', 'username', 'status_text', + 'order_number', ]; }