|
|
@@ -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';
|