lvhao 13 tuntia sitten
vanhempi
commit
eaa3c14386

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

@@ -95,7 +95,8 @@ class Aatest extends Start_Controller {
 		$packages = $extra_text['packages'];
 		$package_id = $packages[0]['id'];
 		$shop = $this->shop->read($info['shop']);
-        $r = $this->apittv1->downloadLabel($package_id,$shop,$info);
+        //$r = $this->apittv1->downloadLabel($package_id,$shop,$info);
+		$r = $this->apittv1->ShipByTiktok($package_id,$shop,$info);
 		var_dump($r);
 		die;
 

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

@@ -459,6 +459,26 @@ function __construct(){
 		$res = json_decode($res,true);
 		return $res;
 	}
+	//商家自定义发货 但是用的tiktok的渠道
+	public function ShipByTiktok($pachage_id,$shop,$info){
+		$url = 'https://open-api.tiktokglobalshop.com';
+		$link = "/fulfillment/202309/packages/".$pachage_id."/ship";
+		$time = time();
+		$post = [
+			"handover_method"=>"DROP_OFF"
+		];
+		$queryParams['shop_cipher'] =$shop['shop_cipher'];
+		$queryParams['app_key'] =$shop['app_key'];
+		$queryParams['timestamp'] =$time;
+		$link .= '?'.http_build_query($queryParams);
+		$sign = $this->sign($link,$shop['app_secret'],$post);
+		$url .= $link.'&sign='.$sign;
+		$headers = array('Content-Type: application/json','x-tts-access-token:'.$shop['token']);
+		$res = $this->su_curl($post,$url,$headers);
+		$this->logic_ding->sendToDing($info['number']."获取通过TT快递服务信息".$res);
+		$res = json_decode($res,true);
+		return $res;
+	}
 	//创建运单
 	public function createLabel($info,$shop){
 		$url = 'https://open-api.tiktokglobalshop.com';

+ 5 - 0
core/CoreApp/models/Model_apittv1.php

@@ -106,6 +106,11 @@ class Model_apittv1 extends Lin_Model {
         ];
     }
 
+    public function ShipByTiktok($package_id,$shop,$info){
+        $r = $this->apitt->ShipByTiktok($package_id,$shop,$info);
+        var_dump($r);
+    }
+
     public function downloadLabel($package_id,$shop,$info){
             $rr1 = $this->apitt->getExpressCompany($info,$shop);
             var_dump($rr1);