|
@@ -12,7 +12,7 @@ class Enterprise extends Validate {
|
|
|
'password' => 'require|min:8|regex:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,}$/',
|
|
|
're_password' => 'require|confirm:password',
|
|
|
'name' => 'require|max:100|checkName', //|regex:/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u
|
|
|
- 'idCard' => 'require|checkID|regex:/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/',
|
|
|
+ 'idCard' => 'require|checkID',
|
|
|
'type' => 'require',
|
|
|
'agencyType' => 'require',
|
|
|
'industryFieldNew' => 'require',
|
|
@@ -92,6 +92,9 @@ class Enterprise extends Validate {
|
|
|
}
|
|
|
|
|
|
protected function checkID($value,$rule,$data=[]){
|
|
|
+ if (!preg_match("/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/", $value)) {
|
|
|
+ return json(['msg' => '统一社会信用代码不正确!', 'code' => 500]);
|
|
|
+ }
|
|
|
$info = EnterpriseModel::where('idCard',$value)->where('delete',0)->where('id','<>',$data['id'])->find();
|
|
|
if($info){
|
|
|
return "该统一社会信用代码已存在";
|