瀏覽代碼

测试获取云途的转单号

lvhao 1 月之前
父節點
當前提交
68363f7fc5
共有 2 個文件被更改,包括 33 次插入1 次删除
  1. 13 1
      core/CoreApp/controllers/Aatest.php
  2. 20 0
      core/CoreApp/models/Model_yuntu.php

+ 13 - 1
core/CoreApp/controllers/Aatest.php

@@ -70,6 +70,8 @@ class Aatest extends Start_Controller {
 		$this->load->_model('Model_itsxb','itsxb');
 		$this->load->_model("Model_logic_order","logic_order");
 		$this->load->_model("Model_job_get3pewaybillid",'job_get3pewaybillid');
+		$this->load->_model("Model_yuntu","yuntu");
+		
     }
 
     //定义方法的调用规则 获取URI第二段值
@@ -118,7 +120,17 @@ class Aatest extends Start_Controller {
 		// echo "<pre>";
 		// print_r($res);
 		// die;
-		echo date("H",time()	);
+		$waybill_numbers = [
+			'YT2515001700102272',
+			'YT2514801700301845',
+			'YT2514901700303013',
+			'YT2514901700303005'
+		];
+		$res = $this->yuntu->getTransferNumber($waybill_numbers);
+		echo "<pre>";
+		print_r($res);
+		die;
+		echo date("H",time());
 		//$this->job_get3pewaybillid->do_job();
     }
 

+ 20 - 0
core/CoreApp/models/Model_yuntu.php

@@ -401,4 +401,24 @@ class Model_yuntu extends Lin_Model
         }
        
     }
+    /**
+     * 获取运单号
+     */
+    public function getTransferNumber($waybill_numbers){
+       // /v1/order/last-mile/get
+
+       $token =  $this->getAccessToken();
+       
+       if(empty($token)){
+           throw new Exception("获取token失败");
+       }
+      
+       $query = [
+           'waybill_numbers'=> $waybill_numbers,
+       ];
+       $url ="/v1/order/last-mile/get";
+       $res = $this->sendPost($url,$query,$token);
+       return $res;
+       
+    }
 }