소스 검색

提交apitt获取联盟的订单

lvhao 1 주 전
부모
커밋
02a7b8809d
2개의 변경된 파일33개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      core/CoreApp/controllers/Aatest.php
  2. 28 0
      core/CoreApp/models/Model_apitt.php

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

@@ -91,7 +91,11 @@ class Aatest extends Start_Controller {
 
     //定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
-    {  
+    {   
+		$shop = $this->shop->read(46);
+		$res = $this->apitt->getAffiliateOrders($shop);
+		echo "<pre>";
+		print_r($res);
 		die;
 		$fullorder = $this->logic_order->getInfo("number = 'TT-WK-251201-337'");
 		$this->express_tt->get_data($fullorder,"CBT");;

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

@@ -526,6 +526,34 @@ function __construct(){
 		return $res;
 	}
 
+	//获取tiktok的来自于直播的订单
+	//或者叫做获取联盟的单子
+	public function getAffiliateOrders($shop){
+		$url = "https://open-api.tiktokglobalshop.com";
+		$link = "/affiliate_partner/202411/orders/search";
+		$time = $end_time = time();
+		$start_time = $end_time - 3600 * 24 *3;
+
+		$post = [
+			'create_time_ge'=>$start_time,
+			"create_time_lt"=>$end_time,
+		];
+		$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快递服务信息CBTXD".$res."【请求参数】".json_encode($post));
+		$res = json_decode($res,true);
+
+
+	}
+
+
+
 	public function get_detail($order_id,$shop){
 		$url = 'https://open-api.tiktokglobalshop.com';
 		$link = '/order/202309/orders';