Browse Source

提交数据

lvhao 2 months ago
parent
commit
54daf79043
1 changed files with 13 additions and 1 deletions
  1. 13 1
      core/CoreApp/models/Model_logic_order.php

+ 13 - 1
core/CoreApp/models/Model_logic_order.php

@@ -238,7 +238,19 @@ class Model_logic_order extends Lin_Model {
             }
 
         }
-
+        
+        if($post['country'] == 192 )
+        {
+            //如果国家是美国 邮编只能是字符串为5位的数字
+            $pattern = '/^\d{5}$/';
+            if(!preg_match($pattern, $post['zipcode'])){
+                return [
+                    'code'=>-1,
+                    "msg"=>"美国的邮编需按5位数格式提交!"
+                ];
+            }
+           
+        }
         // if(in_array($post['express'],[2,63,64])){
         //     if($post['type'] != 5){
         //         return [