mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-30 17:02:04 +08:00 
			
		
		
		
	update: config
This commit is contained in:
		| @@ -47,7 +47,8 @@ class ConfigController extends Controller | ||||
|                     '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_withdraw_limit' => config('v2board.commission_withdraw_limit', 100) | ||||
|                     'commission_withdraw_limit' => config('v2board.commission_withdraw_limit', 100), | ||||
|                     'commission_withdraw_method' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT) | ||||
|                 ], | ||||
|                 'site' => [ | ||||
|                     'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0), | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
|  | ||||
| namespace App\Http\Controllers\User; | ||||
|  | ||||
| use App\Utils\Dict; | ||||
| use Illuminate\Http\Request; | ||||
| use App\Http\Controllers\Controller; | ||||
|  | ||||
| @@ -12,7 +13,8 @@ class CommController extends Controller | ||||
|         return response([ | ||||
|             'data' => [ | ||||
|                 'isTelegram' => (int)config('v2board.telegram_bot_enable', 0), | ||||
|                 'stripePk' => config('v2board.stripe_pk_live') | ||||
|                 'stripePk' => config('v2board.stripe_pk_live'), | ||||
|                 'withdraw_methods' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT) | ||||
|             ] | ||||
|         ]); | ||||
|     } | ||||
|   | ||||
| @@ -8,6 +8,7 @@ use App\Http\Requests\User\TicketWithdraw; | ||||
| use App\Jobs\SendTelegramJob; | ||||
| use App\Models\User; | ||||
| use App\Services\TelegramService; | ||||
| use App\Utils\Dict; | ||||
| use Illuminate\Http\Request; | ||||
| use App\Models\Ticket; | ||||
| use App\Models\TicketMessage; | ||||
| @@ -152,6 +153,15 @@ class TicketController extends Controller | ||||
|  | ||||
|     public function withdraw(TicketWithdraw $request) | ||||
|     { | ||||
|         if (!in_array( | ||||
|             $request->input('withdraw_method'), | ||||
|             config( | ||||
|                 'v2board.commission_withdraw_method', | ||||
|                 Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT | ||||
|             ) | ||||
|         )) { | ||||
|             abort(500, '不支持的提现方式'); | ||||
|         } | ||||
|         $user = User::find($request->session()->get('id')); | ||||
|         $limit = config('v2board.commission_withdraw_limit', 100); | ||||
|         if ($limit > ($user->commission_balance / 100)) { | ||||
| @@ -169,13 +179,7 @@ class TicketController extends Controller | ||||
|             DB::rollback(); | ||||
|             abort(500, '工单创建失败'); | ||||
|         } | ||||
|         $methodText = [ | ||||
|             'alipay' => '支付宝', | ||||
|             'paypal' => '贝宝(Paypal)', | ||||
|             'usdt' => 'USDT', | ||||
|             'btc' => '比特币' | ||||
|         ]; | ||||
|         $message = "提现方式:{$methodText[$request->input('withdraw_method')]}\r\n提现账号:{$request->input('withdraw_account')}\r\n"; | ||||
|         $message = "提现方式:{$request->input('withdraw_method')}\r\n提现账号:{$request->input('withdraw_account')}\r\n"; | ||||
|         $ticketMessage = TicketMessage::create([ | ||||
|             'user_id' => $request->session()->get('id'), | ||||
|             'ticket_id' => $ticket->id, | ||||
|   | ||||
| @@ -23,6 +23,7 @@ class ConfigSave extends FormRequest | ||||
|             'commission_first_time_enable' => 'in:0,1', | ||||
|             'commission_auto_check_enable' => 'in:0,1', | ||||
|             'commission_withdraw_limit' => 'nullable|numeric', | ||||
|             'commission_withdraw_method' => 'nullable|array', | ||||
|             // site | ||||
|             'stop_register' => 'in:0,1', | ||||
|             'email_verify' => 'in:0,1', | ||||
| @@ -34,7 +35,7 @@ class ConfigSave extends FormRequest | ||||
|             'try_out_plan_id' => 'integer', | ||||
|             'try_out_hour' => 'numeric', | ||||
|             'email_whitelist_enable' => 'in:0,1', | ||||
|             'email_whitelist_suffix' => '', | ||||
|             'email_whitelist_suffix' => 'nullable|array', | ||||
|             'email_gmail_limit_enable' => 'in:0,1', | ||||
|             'recaptcha_enable' => 'in:0,1', | ||||
|             'recaptcha_key' => '', | ||||
|   | ||||
| @@ -14,7 +14,7 @@ class TicketWithdraw  extends FormRequest | ||||
|     public function rules() | ||||
|     { | ||||
|         return [ | ||||
|             'withdraw_method' => 'required|in:alipay,paypal,usdt,btc', | ||||
|             'withdraw_method' => 'required', | ||||
|             'withdraw_account' => 'required' | ||||
|         ]; | ||||
|     } | ||||
|   | ||||
| @@ -15,4 +15,9 @@ class Dict | ||||
|         'yeah.net', | ||||
|         'foxmail.com' | ||||
|     ]; | ||||
|     CONST WITHDRAW_METHOD_WHITELIST_DEFAULT = [ | ||||
|         '支付宝', | ||||
|         'USDT', | ||||
|         'Paypal' | ||||
|     ]; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user