恢复 用户必须有 1 元才能开设计费项目

This commit is contained in:
iVampireSP.com 2022-11-24 21:00:58 +08:00
parent 0c8e682acc
commit 6787b46da8
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -24,13 +24,13 @@ public function call(Request $request, Module $module)
$method = Str::lower($request->method());
// 如果 method 为 post, 检查用户余额
// if ($method == 'post') {
// $user = auth()->user();
if ($method == 'post') {
$user = auth()->user();
// if ($user->balance < 1) {
// return $this->error('账户余额不足,请保证账户余额至少有 1 元。');
// }
// }
if ($user->balance < 1) {
return $this->error('账户余额不足,请保证账户余额至少有 1 元。');
}
}
$response = $module->request($method, $path, $request->all());