From c71eb480061aca40b2370e78e764da90b7aefe98 Mon Sep 17 00:00:00 2001 From: lanzu_qinsheng <334039090@qq.com> Date: Sun, 4 Oct 2020 22:48:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E7=8E=B0=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E5=A4=A7=E4=BA=8E=E4=BD=99=E9=A2=9D=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/LanzuCsWithdrawController.php | 2 +- app/Models/LanzuUserBalance.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Admin/Controllers/LanzuCsWithdrawController.php b/app/Admin/Controllers/LanzuCsWithdrawController.php index 34ff468..852de18 100644 --- a/app/Admin/Controllers/LanzuCsWithdrawController.php +++ b/app/Admin/Controllers/LanzuCsWithdrawController.php @@ -101,7 +101,7 @@ class LanzuCsWithdrawController extends AdminController if ($form->money < env('MIN_MONEY') || $form->money > env('MAX_MONEY')) { return $form->error('申请提现金额不得小于 ' . env('MIN_MONEY') . ' 元 或 不得大于 ' . env('MAX_MONEY') . ' 元.'); } - $res = LanzuUserBalance::checkBalance($user->id, $form->money); + $res = LanzuUserBalance::checkBalance($user->id, $form->money, Type::BALANCE_USER_TYPE_CS); if (!$res) { return $form->error('您可提现金额不足!'); } diff --git a/app/Models/LanzuUserBalance.php b/app/Models/LanzuUserBalance.php index f55d0f8..a88d6b6 100644 --- a/app/Models/LanzuUserBalance.php +++ b/app/Models/LanzuUserBalance.php @@ -69,9 +69,12 @@ class LanzuUserBalance extends Model /** * 校验是否在足够的可提现金额 */ - public static function checkBalance($aduid,$money) + public static function checkBalance($aduid,$money,$type) { - return self::where('source_id',$aduid)->where('balance','>=',$money)->count(); + return self::where('source_id',$aduid) + ->where('balance','>=',$money) + ->where('user_type',$type) + ->count(); } }