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(); } }