Browse Source

增加港澳居民居住证

zmw 4 months ago
parent
commit
f8f30af721

+ 6 - 1
app/enterprise/validate/HouseValidator.php

@@ -51,11 +51,16 @@ class HouseValidator extends Validate {
                 return true;
             }
             return "通行证号码不合法";
-        } else {
+        } else if ($data["cardType"] == 3) {
             if (preg_match("/^([a-zA-z]|[0-9]){5,17}$/", $value)) {
                 return true;
             }
             return "护照号码不合法";
+        } else if ($data["cardType"] == 4) {
+            if (preg_match("/^[1-9]\d{5}[0-9]{3}\d{3}[0-9Xx]$/", $value)) {
+                return true;
+            }
+            return "港澳居民居住证不合法";
         }
     }
 

+ 6 - 1
app/enterprise/validate/LivingAllowance.php

@@ -101,11 +101,16 @@ class LivingAllowance extends Validate {
                 return true;
             }
             return "通行证号码不合法";
-        } else {
+        } else if ($data["cardType"] == 3) {
             if (preg_match("/^([a-zA-z]|[0-9]){5,17}$/", $value)) {
                 return true;
             }
             return "护照号码不合法";
+        } else if ($data["cardType"] == 4) {
+            if (preg_match("/^[1-9]\d{5}[0-9]{3}\d{3}[0-9Xx]$/", $value)) {
+                return true;
+            }
+            return "港澳居民居住证不合法";
         }
     }
 

+ 5 - 1
app/enterprise/validate/TalentInfo.php

@@ -148,10 +148,14 @@ class TalentInfo extends Validate {
             if (!preg_match("/^[a-zA-Z0-9]{6,10}$/", $value) && !preg_match("/^([0-9]{8}|[0-9]{10})$/", $value)) {
                 return "通行证号码不合法";
             }
-        } else {
+        } else if ($data["card_type"] == 3) {
             if (!preg_match("/^([a-zA-z]|[0-9]){5,17}$/", $value)) {
                 return "护照号码不合法";
             }
+        } else if ($data["card_type"] == 4) {
+            if (!preg_match("/^[1-9]\d{5}[0-9]{3}\d{3}[0-9Xx]$/", $value)) {
+                return "港澳居民居住证不合法";
+            }
         }
         $db = $this->db->name($rule);
         $where = [];