lvhao hai 3 meses
pai
achega
cb0d1d92b3

+ 8 - 2
core/CoreApp/controllers/Fullordersmt.php

@@ -3553,8 +3553,14 @@ class Fullordersmt extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'不允许修改运单号','success'=>true));exit;
 			}
-			if($post['express'] == 52 && empty($post['email'])){
-				echo json_encode(array('msg'=>'惠程安迈世发货需要有邮箱!','success'=>false));exit;
+			if($post['express'] == 52){
+				if(empty($post['email'])){
+					echo json_encode(array('msg'=>'惠程安迈世发货需要有邮箱!','success'=>false));exit;
+				}else{
+					if(!$this->logic_order->checkEmail($post['email'])){
+						echo json_encode(array('msg'=>'邮箱格式不正确!','success'=>false));exit;
+					}
+				}
 			}
 			$thisdata =  $data;
 			$warehouse = $this->warehouse->read($thisdata['type']);

+ 10 - 0
core/CoreApp/models/Model_logic_order.php

@@ -248,4 +248,14 @@ class Model_logic_order extends Lin_Model {
             return $name;
         }
     }
+    /**
+     * 邮箱验证
+     */
+    public function checkEmail($email){
+        if(preg_match("/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/",$email)){
+            return true;
+        }else{
+            return false;
+        }
+    }
 }