提现金额限制及添加其它技术
This commit is contained in:
@@ -67,15 +67,19 @@ class Account extends Api
|
||||
$user_id = $this->auth->id ?? -1;
|
||||
$amount = $this->request->post('amount', 0);
|
||||
$name = $this->request->post('name', '');
|
||||
// 验证参数
|
||||
// 验证参数(单笔 0.1~200 元,与 AccountWithdrawService 中的限制保持一致)
|
||||
$error = $this->validate($this->request->post(), [
|
||||
'name' => 'require',
|
||||
'amount' => 'require|number|between:1,500',
|
||||
'amount' => 'require|number|float|between:'
|
||||
. AccountWithdrawService::WITHDRAW_MIN_AMOUNT . ','
|
||||
. AccountWithdrawService::WITHDRAW_MAX_AMOUNT,
|
||||
], [
|
||||
'name.require' => '微信真实姓名必填',
|
||||
'amount.require' => '提现金额不正确',
|
||||
'amount.number' => '提现金额必须为数字',
|
||||
'amount.between' => '提现金额必须在1到500之间',
|
||||
'amount.float' => '提现金额必须为数字',
|
||||
'amount.between' => '单笔提现金额需在' . AccountWithdrawService::WITHDRAW_MIN_AMOUNT . '~'
|
||||
. AccountWithdrawService::WITHDRAW_MAX_AMOUNT . '元之间',
|
||||
]);
|
||||
if (true !== $error) {
|
||||
throw new \Exception($error);
|
||||
|
||||
@@ -169,6 +169,7 @@ class Common extends Api
|
||||
$code_languages = config('site.general_config_code_languages') ?? '';
|
||||
$front_techs = config('site.general_config_front_techs') ?? '';
|
||||
$back_techs = config('site.general_config_back_techs') ?? '';
|
||||
$other_techs = config('site.general_config_other_techs') ?? '';
|
||||
$develop_types = config('site.general_config_develop_types') ?? '';
|
||||
$develop_types = explode(',', $develop_types);
|
||||
$developTypes = [];
|
||||
@@ -182,6 +183,7 @@ class Common extends Api
|
||||
'languageLabels' => explode(',', $code_languages),
|
||||
'frontLabels' => explode(',', $front_techs),
|
||||
'backendLabels' => explode(',', $back_techs),
|
||||
'otherLabels' => explode(',', $other_techs),
|
||||
'developTypes' => $developTypes,
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user