lvhao пре 1 недеља
родитељ
комит
a82cc694de
2 измењених фајлова са 21 додато и 3 уклоњено
  1. 3 3
      core/CoreApp/controllers/Aatest.php
  2. 18 0
      core/CoreApp/models/Model_apitt.php

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

@@ -95,10 +95,10 @@ class Aatest extends Start_Controller {
     public function _remap($arg,$arg_array)
     {   
 
-
-		$pdf = $this->huileiv1->get_pdf('19596397');
+		$shop = $this->shop->read();
+		$res = $this->apitt->getLiveOrders(46);
 		echo "<pre>";
-		print_r($pdf);
+		print_r($res);
 		die;
 		echo date("H");
 		die;

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

@@ -622,6 +622,24 @@ function __construct(){
 		$res = json_decode($res,true);
 		return $res;
 	}
+
+	//获取直播单子
+	public function getLiveOrders($shop){
+		$url = 'https://open-api.tiktokglobalshop.com';
+		$link = '/analytics/202508/shop_lives/performance/';
+		$time = time();
+		$start_date_ge = date('Y-m-d', strtotime('-3 day'));
+		$end_date_lt = date('Y-m-d', time());
+		$link .= '?shop_cipher='.$shop['shop_cipher'].'&app_key='.$shop['app_key'].'&timestamp='.$time."&start_date_ge=".$start_date_ge."&end_date_lt=".$end_date_lt;
+		$sign = $this->sign($link,$shop['app_secret'],'');
+		$url .= $link.'&sign='.$sign;
+		$headers = array('Content-Type: application/json','x-tts-access-token:'.$shop['token']);
+		$res = $this->su_curl('',$url,$headers,$date_type='json',$timeout=300,$httptype="GET");
+		//$this->logic_ding->sendToDing($info['number']."获取TT快递服务信息MD".$res);
+		$res = json_decode($res,true);
+		return $res;
+
+	}
 	public function sign($url,$appSecret,$body='') 
 	{
 		// 解析URL获取查询参数