Browse Source

测试sku异常

lvhao 6 months ago
parent
commit
abf17ef939
1 changed files with 66 additions and 5 deletions
  1. 66 5
      core/CoreApp/controllers/Aatest.php

+ 66 - 5
core/CoreApp/controllers/Aatest.php

@@ -39,7 +39,7 @@ class Aatest extends Start_Controller {
 		$this->load->_model('Model_allocation','allocation');
 		$this->load->_model('Model_fullorderxw','fullorderxw');
 		$this->load->_model('Model_fullorderpaypal','fullorderpaypal');
-    	//$this->load->_model('Model_fedexv1','fedexv1');
+    	$this->load->_model('Model_fedexv1','fedexv1');
 		$this->load->_model('Model_logic_crm','logic_crm');
 		$this->load->_model("Model_fullorder","fullorder");
 		$this->load->_model("Model_express","express");
@@ -64,8 +64,8 @@ class Aatest extends Start_Controller {
 			$this->_waybillemail();
 		}else if($arg == 'getorder'){
 			$this->_getorder();
-		}elseif($arg == 'upadtel'){
-			//$this->upadtel();
+		}elseif($arg == 'logistic'){
+			$this->_logistic();
 		}else{
 			$this->_a($arg_array);
 		}
@@ -74,6 +74,18 @@ class Aatest extends Start_Controller {
 	//物流轨迹
 	public function  _logistic(){
 		echo "<pre>";
+		// $list = $this->fullorder->find_all("waybill = 284280923614");
+		// var_dump($list);
+		// die;
+		// $v = $list[0];
+		$v = [
+			'waybill'=>'284280923614'
+		];
+		$fs = $this->fedexv1->get_logistics($v);
+		var_dump($fs);
+		die;
+		die;
+		
 		$list = $this->fullorder->findall("waybill = 9205590251001335234515");
 		$v = $list['0'];
 		@$fs = $this->usps->get_logistics($v);
@@ -125,8 +137,56 @@ class Aatest extends Start_Controller {
 			}	
 	}
 
+	public function getDtc(){
+		$dictionaries = $this->typeclass->find_all('spare!= "" and classid != 1 and classid != 2 and classid != 3 and classid != 4 and classid != 5 and classid != 11 and classid != 16 and classid != 17 and classid != 20 and classid != 21 and classid != 23 and classid != 24 and classid != 29 and classid != 30 and classid != 31 and classid != 32 and classid != 36');
+		$dtc = array();
+		foreach ($dictionaries as $v) 
+		{
+			if(stripos($v['spare'],'|') !== false)//如果有多个值
+			{
+				$v['spare'] = explode('|',$v['spare']);
+				foreach ($v['spare'] as $k=>$vs) 
+		        {
+					if(stripos($v['zh'],'|') !== false)
+					{
+						$vzh = explode('|',$v['zh']);
+						$dtc[strtolower($vs)] = array('classid'=>$v['classid'],'zh'=>$vzh[$k],'id'=>$v['id'],'jm'=>$v['jm'],'spare'=>$vs);
+					}
+					else
+					{
+					    $dtc[strtolower($vs)] = array('classid'=>$v['classid'],'zh'=>$v['zh'],'id'=>$v['id'],'jm'=>$v['jm'],'spare'=>$vs);
+					}
+				}
+			}
+			else
+			{
+				$dtc[strtolower($v['spare'])] = array('classid'=>$v['classid'],'zh'=>$v['zh'],'id'=>$v['id'],'jm'=>$v['jm'],'spare'=>$v['spare']);
+			}
+			
+		}
+		$dtctitle = [];
+		$dictionaries2 = $this->typeclass->find_all();
+		foreach ($dictionaries2 as $v)
+		{
+			$dtctitle[$v['id']] = $v['title'];
+		}
+		return [
+			'dtc'=>$dtc,
+			'dtctitle'=>$dtctitle
+		];
+	}
     public function _a($arg_array){
-		$this->upadtel();
+		$data = $this->getDtc();
+		$dtc = $data['dtc'];
+		$dtctitle = $data['dtctitle'];
+		$quantity = 'Loose Body--HDWig-26-HD5*5Wig-180%,WKPack';
+		$issku = '1;1';
+		$r = $this->api->matching($quantity,$issku,$dtc,0,0,$dtctitle,[],[
+			
+		]);
+		echo "<pre>";
+		var_dump($r);
+		
 		die;
 	
         $time = time();
@@ -193,7 +253,8 @@ class Aatest extends Start_Controller {
 		$waybill = $this->input->get('waybill');
 		$info = $this->fullorder->get_waybill($waybill);
 			
-		$r = $this->usps->get_new_logistics($info);
+		//$r = $this->usps->get_new_logistics($info);
+		$r = $this->fedexv1->get_logistics(123);
 		echo "<pre>";
 		var_dump($r);
         //$this->fedexv1->makeAccessToken();