Forráskód Böngészése

修改导入代发带单

lvhao 3 hónapja
szülő
commit
f05bb131f1
1 módosított fájl, 11 hozzáadás és 3 törlés
  1. 11 3
      core/CoreApp/controllers/Customer.php

+ 11 - 3
core/CoreApp/controllers/Customer.php

@@ -1957,19 +1957,25 @@ class Customer extends Start_Controller {
 					}
 				}
 			}	
-			
 			/*  匹配ID结束  */
 		    $this->db->trans_begin();
 		    foreach ($list as $key=>$value)
 		    {
+				if(empty($value[0])){
+					continue;
+				}
 				$addtess = $value[7].$value[6];
 				$addtess = str_replace(array('/( | | |\s)/',"'"),array(' ',"’"),$addtess);
+
 				$repeat = $this->customer->find_all('phone = "'.$value[4].'" and address = "'.$addtess.'" and shop = '.$shopid);//判断电话地址
 				$sku = $value['2'];
 				$je = (isset($value['12']))?$value['12']:0;
 				if(!empty($value[13])){
 					$value['13'] = str_replace('/','-',$value['13']);
 					$dtime = strtotime($value['13']);
+					if(empty($dtime)){
+						$dtime = time();
+					}
 				}else{
 					$dtime = time();
 				}
@@ -1998,6 +2004,7 @@ class Customer extends Start_Controller {
 				$post['numphone'] = $numphone;
 				if(!isset($repeat[0]))
 				{
+					$post['num'] = 1;
 		    	    $this->customer->insert($post);
                 }
 				else
@@ -2083,8 +2090,9 @@ class Customer extends Start_Controller {
 				$ddpost['slpx'] = $matching['wcslpx'];
 				$ddpost['state'] = 207;
 				$ddpost['type'] = 13;
-
-				$this->fullorder->insert($ddpost);
+					
+			    $this->fullorder->insert($ddpost);
+				
 			}
 			if ($this->db->trans_status() === FALSE)
             {