Commit 839e74cd by 杨树贤

修改校验规则(银行账号)

parent aeb5b301
Showing with 3 additions and 12 deletions
......@@ -18,7 +18,7 @@ class ReceiptValidator
$rules = [
"bank_name" => "required",
"bank_adderss" => "required",
"account_no" => ['required', 'regex:/^[0-9]+$/'],
"account_no" => 'required|alpha_num',
//"account_no" => "required|regex:/^[0-9\-]+$/",
"receipt_type" => 'required',
"certificate" => "required",
......@@ -29,23 +29,13 @@ class ReceiptValidator
$rules["account_name"] = 'required';
$rules["bank_adderss"] = 'required';
$rules["nation_id"] = 'required';
$rules['account_no'] = ['required'];
$rules['account_no'] = 'required|alpha_num';
//$rules["international_code"] = 'required';
}
$messages = $this->messages();
$validator = Validator::make($receipt, $rules, $messages);
$otherErrors = [];
if (!SupplierReceiptService::checkAccountNo($receipt['account_no']) && $receipt['receipt_type'] == 2) {
if ($returnAllError) {
$otherErrors[] = '银行账号仅支持输入数字、英文字母、符号 - () 、空格';
return $otherErrors;
} else {
return '银行账号仅支持输入数字、英文字母、符号 - () 、空格';
}
}
if ($otherErrors) {
return $otherErrors;
}
......@@ -69,6 +59,7 @@ class ReceiptValidator
'swift_code.required' => '银行国际代码 Swift Code 不能为空',
'account_no.required' => '银行账号 不能为空',
'account_no.regex' => '国内银行账号仅支持输入数字且中间不能有空格',
'account_no.alpha_num' => '国内银行账号都只允许输入英文和数字',
'account_name.required' => '账户名称 不能为空',
'certificate.required' => '银行信息凭证 不能为空',
'account_adderss.required' => '银行地址 不能为空',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment