From af14218bab138a349db109c9b6090c2c3c135fef Mon Sep 17 00:00:00 2001 From: lanzu_qsy <334039090@qq.com> Date: Thu, 27 Aug 2020 09:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E5=A4=B1=E8=B4=A5,=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=8F=90=E7=8E=B0=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/LanzuCsWithdrawController.php | 6 ++++++ app/Models/LanzuCsWithdraw.php | 5 +++++ app/Models/LanzuUserBalance.php | 1 + 3 files changed, 12 insertions(+) diff --git a/app/Admin/Controllers/LanzuCsWithdrawController.php b/app/Admin/Controllers/LanzuCsWithdrawController.php index 320272c..3c900a5 100644 --- a/app/Admin/Controllers/LanzuCsWithdrawController.php +++ b/app/Admin/Controllers/LanzuCsWithdrawController.php @@ -159,6 +159,12 @@ class LanzuCsWithdrawController extends AdminController $model->save(); } else { + //提现失败,退回提现金额 + LanzuUserBalance::returnBalance($form->model()->cs_id, 3, $form->model()->money); + + //更改提现状态为-2 提现失败 + \App\Models\LanzuCsWithdraw::updateStatus($form->id,-2); + //记录失败日志 Log::error('提现失败.', $res); return $form->error($res['err_code_des']); diff --git a/app/Models/LanzuCsWithdraw.php b/app/Models/LanzuCsWithdraw.php index 3fd6c6a..04faf78 100644 --- a/app/Models/LanzuCsWithdraw.php +++ b/app/Models/LanzuCsWithdraw.php @@ -27,4 +27,9 @@ class LanzuCsWithdraw extends Model { return date('Y-m-d H:i',$value); } + //变更提现状态 + public static function updateStatus($id,$status) + { + return self::where('id',$id)->update(['status'=>$status]); + } } diff --git a/app/Models/LanzuUserBalance.php b/app/Models/LanzuUserBalance.php index 6225f2e..bd585be 100644 --- a/app/Models/LanzuUserBalance.php +++ b/app/Models/LanzuUserBalance.php @@ -74,4 +74,5 @@ class LanzuUserBalance extends Model { return self::where('source_id',$aduid)->where('balance','>=',$money)->count(); } + }