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

上传tiktok的信息

lvhao 1 napja
szülő
commit
25b32a08a7

+ 1 - 1
core/CoreApp/models/Model_apitt.php

@@ -417,7 +417,7 @@ function __construct(){
 		$post['slpx'] = $matching['wcslpx'];
 		return $post;
 	}
-	public function getExpressCompany($shop,$info){
+	public function getExpressCompany($info,$shop){
 		$url = 'https://open-api.tiktokglobalshop.com';
 		$link = "/fulfillment/202309/orders/".trim($info['orderinfo'])."/shipping_services/query";
 		$time = time();

+ 21 - 20
core/CoreApp/models/Model_express_tt.php

@@ -126,16 +126,16 @@ class Model_express_tt extends Lin_Model {
     private function getFBTPackage($info,$shop_info){
         $extra_text = $info['extra_text'];
         $packages = $extra_text['packages'];
-        // if(!isset($extra_text['server_info'])){
-        //     $rr1 = $this->getExpressCompany($info,$shop_info);
-        //     if($rr1['x'] == 0){
-        //         return $rr1;
-        //     }
-        //     $info = $rr1['data'];
-        //     if(is_string($info['extra_text'])){
-        //         $info['extra_text'] = json_decode($info['extra_text'],true);
-        //     }
-        // }
+        if(!isset($extra_text['server_info'])){
+            $rr1 = $this->getExpressCompany($info,$shop_info);
+            if($rr1['x'] == 0){
+                return $rr1;
+            }
+            $info = $rr1['data'];
+            if(is_string($info['extra_text'])){
+                $info['extra_text'] = json_decode($info['extra_text'],true);
+            }
+        }
         // 确定没有多包裹的情况 就不再写循环了 直接获取第一个包裹
         // foreach($packages as $package){
         //     $rr = $this->apitt->downloadLabel($package['id'],$shop_info[0],$info);
@@ -150,16 +150,17 @@ class Model_express_tt extends Lin_Model {
         //     }
         // }
 
-        // if(!isset($extra_text['label_info'])){
-        //     $rr2 = $this->createExpressLabel($info,$shop_info);
-        //     if($rr2['x'] == 0){
-        //         return $rr2;
-        //     }
-        //     $info = $rr2['data'];
-        //     if(is_string($info['extra_text'])){
-        //         $info['extra_text'] = json_decode($info['extra_text'],true);
-        //     }
-        // }
+        if(!isset($extra_text['label_info'])){
+            $rr2 = $this->createExpressLabel($info,$shop_info);
+            if($rr2['x'] == 0){
+                return $rr2;
+            }
+            $info = $rr2['data'];
+            if(is_string($info['extra_text'])){
+                $info['extra_text'] = json_decode($info['extra_text'],true);
+            }
+        }
+        
         $packageid = $packages[0]['id'];
         $rr = $this->apitt->downloadLabel($packageid,$shop_info[0],$info);
         if($rr['code']!=0){