|
@@ -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', 'unique:un_enterprise', 'regex:/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/'],
|
|
|
+ 'idCard' => 'require|checkID|regex:/^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/',
|
|
|
'type' => 'require',
|
|
|
'agencyType' => 'require',
|
|
|
'industryFieldNew' => 'require',
|
|
@@ -91,4 +91,13 @@ class Enterprise extends Validate {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ protected function checkID($value,$rule,$data=[]){
|
|
|
+ $info = EnterpriseModel::where('idCard',$value)->where('delete',0)->where('id','<>',$data['id'])->find();
|
|
|
+ if($info){
|
|
|
+ return "该统一社会信用代码已存在";
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|