Browse Source

增加港澳居民居住证

zmw 4 months ago
parent
commit
a078679c2d

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

@@ -57,7 +57,7 @@ class HouseValidator extends Validate {
             }
             return "护照号码不合法";
         } else if ($data["cardType"] == 4) {
-            if (preg_match("/^810000\d{8}(0[1-9]|[12][0-9]|3[01])\d{3}[0-9Xx]$/", $value)) {
+            if (preg_match("/^8[123]0000(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/", $value)) {
                 return true;
             }
             return "港澳居民居住证不合法";

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

@@ -107,7 +107,7 @@ class LivingAllowance extends Validate {
             }
             return "护照号码不合法";
         } else if ($data["cardType"] == 4) {
-            if (preg_match("/^810000\d{8}(0[1-9]|[12][0-9]|3[01])\d{3}[0-9Xx]$/", $value)) {
+            if (preg_match("/^8[123]0000(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/", $value)) {
                 return true;
             }
             return "港澳居民居住证不合法";

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

@@ -153,7 +153,7 @@ class TalentInfo extends Validate {
                 return "护照号码不合法";
             }
         } else if ($data["card_type"] == 4) {
-            if (!preg_match("/^810000\d{8}(0[1-9]|[12][0-9]|3[01])\d{3}[0-9Xx]$/", $value)) {
+            if (!preg_match("/^8[123]0000(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/", $value)) {
                 return "港澳居民居住证不合法";
             }
         }