"application/json" ]; public function token(): static { $this->header = [ "cookie" => $this->getCookie() ]; return $this; } /** * 获取达人投稿视频消耗数据 * https://www.xingtu.cn/gw/api/task/provider_get_star_task_item_list * POST * {"page":1,"limit":10,"query":{"provider_confirmed":false,"task_search_key":"7628487095040311348","qc_metrics_time_range_param":{"start_time":"1762963200000","end_time":"1778687999000"}}} * @return array */ public function getAuthorVideo(string $jobId = "",int $page = 1,int $size = 10): array { $param = [ "page" => $page, "limit" => $size, "query" => [ "provider_confirmed" => false, "task_search_key" => $jobId, "qc_metrics_time_range_param" => [ "start_time" => strtotime(date("Y-m-d 00:00:00",strtotime("-180 day"))) * 1000, "end_time" => strtotime(date("Y-m-d 23:59:59")) * 1000, ] ] ]; $resp = Http::withHeaders($this->header)->post("https://www.xingtu.cn/gw/api/task/provider_get_star_task_item_list",$param)->array(); if ($resp['base_resp']['status_code'] <> 0) return [0,'获取数据失败']; return [1,['total' => $resp['pagination']['total_count'],'has_more' => $resp['pagination']['has_more'],'list' => $resp['item_list']]]; } /** * 生成邀约达人参与任务二维码 * @param string $jobId * @return array */ public function createJobQrcode(string $jobId = ""): array { $param = [ "template_id" => "7550880075256709158", "placeholder_params" => [ "challenge_id" => $jobId, "provider_id" => "1829709687645195", "utm_medium" => "xingtu_provider_star_qc_unite_invite" ], "expired_time" => strtotime("+1 year"), // 有效期1年 "event_id" => $jobId, "share_type" => 4 ]; $resp = Http::withHeaders($this->header)->post("https://www.xingtu.cn/gw/api/fe_common_service/share/info",$param)->array(); if ($resp['base_resp']['status_code'] <> 0) return [0,'生成失败']; return [1,"https://www.xingtu.cn/share/{$resp['share_id']}?hide_nav_bar=1&hide_status_bar=1&should_full_screen=1&utm_source=share_4&session_track_id={$resp['share_id']}"]; } /** * 星川任务详情 * @param string $jobId * @return array */ public function getJobDetail(string $jobId = ""): array { return Http::withHeaders($this->header)->get("https://www.xingtu.cn/gw/api/task/provider_get_project_detail",['project_id' => $jobId])->array(); } protected function getCookie(): string { return "passport_csrf_token=dc2c5075e29c15785b2433afb8d9dd10; passport_csrf_token_default=dc2c5075e29c15785b2433afb8d9dd10; is_staff_user=false; has_biz_token=false; x-web-secsdk-uid=f676fb7e-81a3-42e2-b9e1-73c0ea919aea; csrf_session_id=5499e75e3f1f76a628c1efa81b7c89b3; tt_webid=7637860647254296090; Hm_lvt_5d77c979053345c4bd8db63329f818ec=1778328034; HMACCOUNT=DE9169EBCCD81810; passport_auth_status=93b289d15b8bb4866b32877a48a3b4b6%2C3a1cc997a270fa7b4f4fb3c3a79939fd; passport_auth_status_ss=93b289d15b8bb4866b32877a48a3b4b6%2C3a1cc997a270fa7b4f4fb3c3a79939fd; uid_tt=b918d45f40210fd4799129be8d1e7ae1; uid_tt_ss=b918d45f40210fd4799129be8d1e7ae1; sid_tt=2cf53e24db19ce7e1d9094d82a7e0a15; sessionid=2cf53e24db19ce7e1d9094d82a7e0a15; sessionid_ss=2cf53e24db19ce7e1d9094d82a7e0a15; Hm_lpvt_5d77c979053345c4bd8db63329f818ec=1778501158; sid_guard=2cf53e24db19ce7e1d9094d82a7e0a15%7C1778501177%7C5184000%7CFri%2C+10-Jul-2026+12%3A06%3A17+GMT; session_tlb_tag=sttt%7C14%7CLPU-JNsZzn4dkJTYKn4KFf_________UDv5aLsuhDiFj6DTslfpmqljmlqIjrEWo6QWJ6REal5U%3D; sid_ucp_v1=1.0.0-KDMyOTUxMzAzNDFkZjFjMzBmYzYyNWJjNGU3YTFiYTcwODYyOGJjZjAKFwiUv5Cvv8yyBxC5jIfQBhj6EzgCQPEHGgJscSIgMmNmNTNlMjRkYjE5Y2U3ZTFkOTA5NGQ4MmE3ZTBhMTU; ssid_ucp_v1=1.0.0-KDMyOTUxMzAzNDFkZjFjMzBmYzYyNWJjNGU3YTFiYTcwODYyOGJjZjAKFwiUv5Cvv8yyBxC5jIfQBhj6EzgCQPEHGgJscSIgMmNmNTNlMjRkYjE5Y2U3ZTFkOTA5NGQ4MmE3ZTBhMTU; star_sessionid=485fed1891a1b504a23ee3ce76ccd568"; } }