update: commission withdraw limit

This commit is contained in:
Tokumeikoi 2020-10-29 00:37:37 +08:00
parent 06d22e7585
commit c02db9d957
4 changed files with 9 additions and 2 deletions

View File

@ -46,7 +46,8 @@ class ConfigController extends Controller
'invite_gen_limit' => config('v2board.invite_gen_limit', 5),
'invite_never_expire' => config('v2board.invite_never_expire', 0),
'commission_first_time_enable' => config('v2board.commission_first_time_enable', 1),
'commission_auto_check_enable' => config('v2board.commission_auto_check_enable', 1)
'commission_auto_check_enable' => config('v2board.commission_auto_check_enable', 1),
'commission_withdraw_limit' => config('v2board.commission_withdraw_limit', 100)
],
'site' => [
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),

View File

@ -152,6 +152,11 @@ class TicketController extends Controller
public function withdraw(TicketWithdraw $request)
{
$user = User::find($request->session()->get('id'));
$limit = config('v2board.commission_withdraw_limit', 100);
if ($limit < ($user->commission_balance / 100)) {
abort(500, '当前系统要求的提现门槛为:' . $limit);
}
DB::beginTransaction();
$subject = '[提现申请]本工单由系统发出';
$ticket = Ticket::create([

View File

@ -22,6 +22,7 @@ class ConfigSave extends FormRequest
'invite_never_expire' => 'in:0,1',
'commission_first_time_enable' => 'in:0,1',
'commission_auto_check_enable' => 'in:0,1',
'commission_withdraw_limit' => 'nullable|numeric',
// site
'stop_register' => 'in:0,1',
'email_verify' => 'in:0,1',

File diff suppressed because one or more lines are too long