Kaynağa Gözat

修改独立站客户导入单 因为邮箱错误造成程序异常,以及通知错误的信息

lvhao 14 saat önce
ebeveyn
işleme
c068c562b8
1 değiştirilmiş dosya ile 20 ekleme ve 5 silme
  1. 20 5
      core/CoreApp/controllers/Customer.php

+ 20 - 5
core/CoreApp/controllers/Customer.php

@@ -1695,9 +1695,9 @@ class Customer extends Start_Controller {
 					}
 				}
 			}	
-			
 			/*  匹配ID结束  */
 		    $this->db->trans_begin();
+			$error = "";
 		    foreach ($list as $key=>$value)
 		    {
 				$addtess = ($value['15']!='--'?$value['15'].' ':'').($value['14']!='--'?$value['14'].' ':'').$value['13'];
@@ -1722,6 +1722,12 @@ class Customer extends Start_Controller {
 				
 				$post['name'] = ($value['10'] && $value['10'] != 'NULL')?str_replace(array('/( | | |\s)/',"'"),array(' ',"’"),$value['10']):'';
 				$post['email'] = $value['12'];
+				$res = $this->logic_order->checkEmail($post['email']);
+				if(!$res){
+					$error .= "第".($key+2)."行邮箱格式错误;";
+					$i++;
+					continue;
+				}
 				if($value['20'] != '')
 				{
 					$country = $this->country->get_ename(str_replace(array('/( | | |\s)/',"'"),array(' ',"’"),$value['20']));
@@ -1789,6 +1795,7 @@ class Customer extends Start_Controller {
 				$d = $this->fullorder->get_orderinfo($ddpost['orderinfo']);
 				if(isset($d['id']))
 				{
+					$error .= "第".($key+2)."行订单号重复;";
 					$i++;
 					continue;
 				}
@@ -1842,11 +1849,11 @@ class Customer extends Start_Controller {
             {
 				if(count($list) == $i)
 				{
-					$til = '导入全部失败!请检查导入信息';
+					$til = '导入全部失败!请检查导入信息;'.$error;
 				}
 				else if(count($list) > $i && $i != 0)
 				{
-					$til = '部分导入成功!'.$i.'条信息有问题,请排查';
+					$til = '部分导入成功!'.$i.'条信息有问题,请排查;'.$error;
 				}
 				else  if($i < 1)
 				{
@@ -1988,6 +1995,7 @@ class Customer extends Start_Controller {
 			}	
 			/*  匹配ID结束  */
 		    $this->db->trans_begin();
+			$error = "";
 		    foreach ($list as $key=>$value)
 		    {
 				if(empty($value[0])){
@@ -2011,6 +2019,12 @@ class Customer extends Start_Controller {
 				$dtime = $dtime + $key;
 				$post['name'] = (!empty($value[3]))?str_replace(array('/( | | |\s)/',"'"),array(' ',"’"),$value['3']):'';
 				$post['email'] = $value['5'];
+				$res = $this->logic_order->checkEmail($post['email']);
+				if(!$res){
+					$error .= '第'.($key+2).'行邮箱格式错误;';
+					$i++;
+					continue;
+				}
 				if($value['11'] != '')
 				{
 					$country = $this->country->get_ename(str_replace(array('/( | | |\s)/',"'"),array(' ',"’"),$value['11']));
@@ -2078,6 +2092,7 @@ class Customer extends Start_Controller {
 				$d = $this->fullorder->get_orderinfo($ddpost['orderinfo']);
 				if(isset($d['id']))
 				{
+					$error .= '第'.($key+2).'行订单号重复;';
 					$i++;
 					continue;
 				}
@@ -2132,11 +2147,11 @@ class Customer extends Start_Controller {
             {
 				if(count($list) == $i)
 				{
-					$til = '导入全部失败!请检查导入信息';
+					$til = '导入全部失败!请检查导入信息;'.$error;
 				}
 				else if(count($list) > $i && $i != 0)
 				{
-					$til = '部分导入成功!'.$i.'条信息有问题,请排查';
+					$til = '部分导入成功!'.$i.'条信息有问题,请排查;'.$error;
 				}
 				else  if($i < 1)
 				{