where("adzone_id",$pid) ->first(); $url = self::$baseUrl."api-zhuanlian"; $params = [ "appkey"=>$taobao["heima_app_key"], "appsecret"=>$taobao["heima_app_secret"], "sid"=>$taobao["heima_sid"], "pid"=>$taobao["adzone_code"], "num_iid"=>$goodsId, "signurl"=>1 ]; $res = HttpCurl::getCurl($url,$params); $url = $res["url"]; $response = HttpCurl::getCurl($url); if(isset($response["tbk_privilege_get_response"])){ return $response["tbk_privilege_get_response"]["result"]["data"]; } $instance = new LoggerFactoryUtil(HeiMaUtil::class); $instance->info("上游返回信息:".json_encode($response)); throw new CommonException(ErrorEnum::ERROR_SYSTEM); } /** * 获取订单列表 */ public static function getOrderList($heima) { $url = self::$baseUrl."api-order"; $params = [ "appkey"=>$heima["heima_app_key"], "appsecret"=>$heima["heima_app_secret"], "sid"=>$heima["heima_sid"], "start_time"=>date("Y-m-d H:i:s",time()-20*60), "end_time"=>date("Y-m-d H:i:s"), // "start_time"=>"2021-12-17 13:40:00", // "end_time"=>"2021-12-17 15:40:00", "page_no"=>1, "page_size"=>100, "signurl"=>1, "query_type"=>4 ]; $res = HttpCurl::getCurl($url,$params); if(isset($res["error"])){ //存在错误则报警 BaseUtil::sendBaoJing("获取订单失败",$res,"定时获取黑马淘客订单"); } $url = $res["url"]; $response = HttpCurl::getCurl($url); if(!isset($response["tbk_sc_order_details_get_response"])){ //存在错误则报警 BaseUtil::sendBaoJing("获取订单失败",$response,"定时获取黑马淘客订单"); } return $response["tbk_sc_order_details_get_response"]["data"]["results"]["publisher_order_dto"]; } }