feature: close withdraw

This commit is contained in:
tokumeikoi 2021-02-03 19:17:32 +09:00
parent 2979003b6f
commit 77f6b3f289
9 changed files with 19 additions and 7 deletions

View File

@ -65,7 +65,11 @@ class CheckCommission extends Command
foreach ($order as $item) {
$inviter = User::find($item->invite_user_id);
if (!$inviter) continue;
$inviter->commission_balance = $inviter->commission_balance + $item->commission_balance;
if ((int)config('v2board.withdraw_close_enable', 0)) {
$inviter->balance = $inviter->balance + $item->commission_balance;
} else {
$inviter->commission_balance = $inviter->commission_balance + $item->commission_balance;
}
DB::beginTransaction();
if ($inviter->save()) {
$item->commission_status = 2;

View File

@ -48,7 +48,8 @@ class ConfigController extends Controller
'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_method' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT)
'commission_withdraw_method' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT),
'withdraw_close_enable' => config('v2board.withdraw_close_enable', 0)
],
'site' => [
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),

View File

@ -14,7 +14,8 @@ class CommController extends Controller
'data' => [
'isTelegram' => (int)config('v2board.telegram_bot_enable', 0),
'stripePk' => config('v2board.stripe_pk_live'),
'withdraw_methods' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT)
'withdraw_methods' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT),
'withdraw_close' => (int)config('v2board.withdraw_close_enable', 0)
]
]);
}

View File

@ -153,6 +153,9 @@ class TicketController extends Controller
public function withdraw(TicketWithdraw $request)
{
if ((int)config('v2board.withdraw_close_enable', 0)) {
abort(500, 'user.ticket.withdraw.not_support_withdraw');
}
if (!in_array(
$request->input('withdraw_method'),
config(

View File

@ -24,6 +24,7 @@ class ConfigSave extends FormRequest
'commission_auto_check_enable' => 'in:0,1',
'commission_withdraw_limit' => 'nullable|numeric',
'commission_withdraw_method' => 'nullable|array',
'withdraw_close_enable' => 'in:0,1',
// site
'stop_register' => 'in:0,1',
'email_verify' => 'in:0,1',

View File

@ -236,5 +236,5 @@ return [
| The only modification by laravel config
|
*/
'version' => '1.4.3.1611667211'
'version' => '1.4.3.1612347430'
];

File diff suppressed because one or more lines are too long

View File

@ -55,7 +55,8 @@ return [
'system_require_withdraw_limit' => 'The current required minimum withdrawal commission is: ¥:limitCNY',
'ticket_subject' => '[Commission Withdrawal Request] This ticket is opened by the system',
'ticket_create_failed' => 'Failed to open ticket',
'ticket_message' => "Withdrawal method: :method\r\nPayment account: :account\r\n"
'ticket_message' => "Withdrawal method: :method\r\nPayment account: :account\r\n",
'not_support_withdraw' => 'Unsupported withdrawal'
]
],
'plan' => [

View File

@ -55,7 +55,8 @@ return [
'system_require_withdraw_limit' => '当前系统要求的最少提现佣金为:¥:limitCNY',
'ticket_subject' => '[提现申请] 本工单由系统发出',
'ticket_create_failed' => '工单创建失败',
'ticket_message' => "提现方式::method\r\n提现账号::account\r\n"
'ticket_message' => "提现方式::method\r\n提现账号::account\r\n",
'not_support_withdraw' => '不支持提现'
]
],
'plan' => [