lvhao 2 dni temu
rodzic
commit
f3abbbcdf8

+ 2 - 2
core/CoreApp/controllers/Aatest.php

@@ -106,8 +106,8 @@ class Aatest extends Start_Controller {
     }
 
 	private function _ttexpress(){
-		$info = $this->logic_order->getInfo("number = 'TT-WK-251020-164'");
-		$res = $this->express_tt->getData($info);
+		$info = $this->logic_order->getInfo("number = 'TT-KISS-251020-002'");
+		$res = $this->express_tt->getData($info,'FBT');
 	}
 	private function dokucun(){
 		//美仓 未出库

+ 47 - 28
core/CoreApp/models/Model_express_tt.php

@@ -4,39 +4,58 @@ class Model_express_tt extends Lin_Model {
         parent::__construct();
         $this->load->_model("Model_apitt","apitt");
     }
-    public function getData($info){
+
+    
+    public function getData($info,$type = 'CBT'){
         if(empty($info)){
-             return $g = [
-                'x'=>0,
-                'Description'=>'订单信息不存在',
-            ];
-        }
-        $shop_info = $this->db->from('shop')->where('id', $info['shop'])->get()->result_array();
-        
-        if(empty($shop_info)){
+            return $g = [
+               'x'=>0,
+               'Description'=>'订单信息不存在',
+           ];
+       }
+       $shop_info = $this->db->from('shop')->where('id', $info['shop'])->get()->result_array();
+       
+       if(empty($shop_info)){
+           return  [
+               'x'=>0,
+               'Description'=>'该商铺不存在',
+           ];
+       }
+        if($type == 'CBT'){
+           
+           //获取快递服务信息
+           $res = $this->getExpressCompany($info,$shop_info[0]);
+           if($res['x'] == 0){
+               return $res;
+           }
+           $res1 = $this->createExpressLabel($res['data'],$shop_info[0]);
+           if($res1['x'] == 0){
+               return $res1;
+           }
+           $res2 = $this->downloadExpressLabel($res['data'],$shop_info[0]);
+           if($res2['x'] == 0){
+               return $res2;
+           }
+           return  [
+               'x'=>1,
+               'msg'=>'获取成功',
+               'data'=>$info
+           ];
+        }else if($type == 'FBT'){
+            $res = $this->apitt->get_data([$info['orderinfo']],$shop_info[0]);
+            echo "<pre>";
+            print_r($res);
+            die;
+        }else{
             return  [
                 'x'=>0,
-                'Description'=>'该商铺不存在',
+                'Description'=>'暂不支持该快递类型',    
             ];
         }
-        //获取快递服务信息
-        $res = $this->getExpressCompany($info,$shop_info[0]);
-        if($res['x'] == 0){
-            return $res;
-        }
-        $res1 = $this->createExpressLabel($res['data'],$shop_info[0]);
-        if($res1['x'] == 0){
-            return $res1;
-        }
-        $res2 = $this->downloadExpressLabel($res['data'],$shop_info[0]);
-        if($res2['x'] == 0){
-            return $res2;
-        }
-        return  [
-            'x'=>1,
-            'msg'=>'获取成功',
-            'data'=>$info
-        ];
+        
+    }
+    private function getOrderDetail($info,$shop_info){
+
     }
    
     //获取订单承运的快递商