afa 2 tháng trước cách đây
mục cha
commit
2aac5a7521

+ 33 - 149
app/admin/command/TaskDy.php

@@ -29,6 +29,34 @@ use GuzzleHttp\Psr7\Request;
 //抖音
 class TaskDy extends Command
 {
+    
+    //抖音请求地址
+    protected $url = 'https://fsdy2.fengsutb.com/amount/ship-list-new';
+
+    //抖音请求头部
+    protected $headers = [
+        'Host' => 'fsdy2.fengsutb.com',
+        'Connection' => 'keep-alive',
+        'sec-ch-ua-platform' => 'Windows',
+        'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
+        'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
+        'sec-ch-ua-mobile' => '?0',
+        'doudian-event-id' => '1757940551000163',
+        'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
+        'Accept' => 'application/json, text/plain, */*',
+        'platform' => 'dy',
+        'Origin' => 'https://fx.fengsutb.com',
+        'Sec-Fetch-Site' => 'same-site',
+        'Sec-Fetch-Mode' => 'cors',
+        'Sec-Fetch-Dest' => 'empty',
+        'Referer' => 'https://fx.fengsutb.com/',
+        'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
+        'Content-Type' => 'application/json',
+    ];
+
+    
+    
+    
     // 指令配置
     protected function configure()
     {
@@ -39,7 +67,7 @@ class TaskDy extends Command
     protected function execute(Input $input, Output $output)
     {
         $client = new Client([ 'verify' => false]);
-        $last_time = CrontabLog::getLastRunTime(0);
+        $last_time = CrontabLog::getLastRunTime(2);
         $body = '{
         "goodType": 2,
         "goodsFlag": 1,
@@ -54,7 +82,7 @@ class TaskDy extends Command
         "timeType": 2,
         "tradeStatus": 2
         }';
-        $request = new Request('POST', $this->getUrl('dy'), $this->getHeaders('dy'), $body);
+        $request = new Request('POST', $this->url, $this->headers, $body);
         $res = $client->sendAsync($request)->wait();
         if($res->getStatusCode() == 200) {
             $data = json_decode($res->getBody()->getContents(), true);  
@@ -92,10 +120,7 @@ class TaskDy extends Command
             // 保存到数据库
             (new FengsuShip())->saveAll($queue);
             // 更新最后执行时间
-            CrontabLog::create([
-                'type_id' => 0,
-                'last_time' => date('Y-m-d H:i:s'),
-            ]);
+            CrontabLog::create(['type_id' => 2,'last_time' => date('Y-m-d H:i:s')]);
         }
 
         // 指令输出
@@ -103,150 +128,9 @@ class TaskDy extends Command
     }
 
 
-    //获取请求url
-    protected function getUrl(string $key):string
-    {
-        $url = [
-            'tb'  => 'https://fszntb.zhifeiyun.cn/amount/ship-list-new', //淘宝
-            'pdd' => 'https://fsfxpdd.fengsutb.com/amount/ship-list-new', //拼多多
-            'dy'  => 'https://fsdy2.fengsutb.com/amount/ship-list-new', //抖音
-            'ks'  => 'https://fsks.fengsutb.com/amount/ship-list-new',   //快手
-            'jd'  => 'https://fsjd.fengsutb.com/amount/ship-list-new', //京东
-            'xhs' => 'https://fsxpt.fengsutb.com/amount/ship-list-new', //小红书
-        ];
-        return $url[$key] ?? $url['tb'];
-    }
 
-    //获取头部
-    protected function getHeaders(string $key):array{
-        $header = [
-            'tb' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "tb",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'pdd' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "pdd",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
-                'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
-                'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
-            ],
-            'dy'=> [
-                'Host' => 'fsdy2.fengsutb.com',
-                'Connection' => 'keep-alive',
-                'sec-ch-ua-platform' => 'Windows',
-                'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
-                'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                'sec-ch-ua-mobile' => '?0',
-                'doudian-event-id' => '1757940551000163',
-                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
-                'Accept' => 'application/json, text/plain, */*',
-                'platform' => 'dy',
-                'Origin' => 'https://fx.fengsutb.com',
-                'Sec-Fetch-Site' => 'same-site',
-                'Sec-Fetch-Mode' => 'cors',
-                'Sec-Fetch-Dest' => 'empty',
-                'Referer' => 'https://fx.fengsutb.com/',
-                'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
-                'Content-Type' => 'application/json',
-            ],
-            'ks'=> [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsks.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "ks",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'jd'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsjd.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "jd",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'xhs'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"        => "fsxpt.fengsutb.com",
-                "Origin"      => "https://fx.fengsutb.com",
-                "platform"    => "xhs",
-                "Pragma"      => "no-cache",
-                "Referer"     => "https://fx.fengsutb.com/",
-                "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ]
-        ];
-        return $header[$key] ?? [];
-    }
+
+ 
 
 
 }

+ 30 - 151
app/admin/command/TaskJd.php

@@ -29,17 +29,43 @@ use GuzzleHttp\Psr7\Request;
 //京东
 class TaskJd extends Command
 {
+    
+    protected $url = 'https://fsjd.fengsutb.com/amount/ship-list-new';
+
+    protected $headers = [
+            'Accept'=> "application/json, text/plain, */*",
+            'Accept-Encoding'=> "gzip, deflate, br, zstd",
+            'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+            "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
+            "Cache-Control"=> "no-cache",
+            'Connection'   => 'keep-alive',
+            "Content-Type"=> "application/json",
+            "Host"      => "fsjd.fengsutb.com",
+            "Origin"    => "https://fx.fengsutb.com",
+            "platform" => "jd",
+            "Pragma"=> "no-cache",
+            "Referer"=> "https://fx.fengsutb.com/",
+            "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
+            "Sec-ch-ua-Mobile"=> "?0",
+            "Sec-ch-ua-platform"=> "Windows",
+            "Sec-Fetch-Dest" => "empty",
+            "Sec-Fetch-Mode" => "cors",
+            "Sec-Fetch-Site" => "same-site",
+            "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
+    ];
+
+
     // 指令配置
     protected function configure()
     {
         $this->setName('task:jd')->setDescription('the task command');
     }
 
-    //根据shop_id
+    //根据
     protected function execute(Input $input, Output $output)
     {
         $client = new Client([ 'verify' => false]);
-        $last_time = CrontabLog::getLastRunTime(0);
+        $last_time = CrontabLog::getLastRunTime(4);
         $body = '{
         "goodType": 2,
         "goodsFlag": 1,
@@ -54,7 +80,7 @@ class TaskJd extends Command
         "timeType": 2,
         "tradeStatus": 2
         }';
-        $request = new Request('POST', $this->getUrl('dy'), $this->getHeaders('dy'), $body);
+        $request = new Request('POST', $this->url, $this->headers, $body);
         $res = $client->sendAsync($request)->wait();
         if($res->getStatusCode() == 200) {
             $data = json_decode($res->getBody()->getContents(), true);  
@@ -92,161 +118,14 @@ class TaskJd extends Command
             // 保存到数据库
             (new FengsuShip())->saveAll($queue);
             // 更新最后执行时间
-            CrontabLog::create([
-                'type_id' => 0,
-                'last_time' => date('Y-m-d H:i:s'),
-            ]);
+            CrontabLog::create(['type_id' => 4,'last_time' => date('Y-m-d H:i:s')]);
         }
-
         // 指令输出
         $output->writeln('ok');
     }
 
 
-    //获取请求url
-    protected function getUrl(string $key):string
-    {
-        $url = [
-            'tb'  => 'https://fszntb.zhifeiyun.cn/amount/ship-list-new', //淘宝
-            'pdd' => 'https://fsfxpdd.fengsutb.com/amount/ship-list-new', //拼多多
-            'dy'  => 'https://fsdy2.fengsutb.com/amount/ship-list-new', //抖音
-            'ks'  => 'https://fsks.fengsutb.com/amount/ship-list-new',   //快手
-            'jd'  => 'https://fsjd.fengsutb.com/amount/ship-list-new', //京东
-            'xhs' => 'https://fsxpt.fengsutb.com/amount/ship-list-new', //小红书
-        ];
-        return $url[$key] ?? $url['tb'];
-    }
 
-    //获取头部
-    protected function getHeaders(string $key):array{
-        $header = [
-            'tb' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "tb",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'pdd' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "pdd",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
-                'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
-                'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
-            ],
-            'dy'=> [
-                'Host' => 'fsdy2.fengsutb.com',
-                'Connection' => 'keep-alive',
-                'sec-ch-ua-platform' => 'Windows',
-                'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
-                'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                'sec-ch-ua-mobile' => '?0',
-                'doudian-event-id' => '1757940551000163',
-                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
-                'Accept' => 'application/json, text/plain, */*',
-                'platform' => 'dy',
-                'Origin' => 'https://fx.fengsutb.com',
-                'Sec-Fetch-Site' => 'same-site',
-                'Sec-Fetch-Mode' => 'cors',
-                'Sec-Fetch-Dest' => 'empty',
-                'Referer' => 'https://fx.fengsutb.com/',
-                'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
-                'Content-Type' => 'application/json',
-            ],
-            'ks'=> [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsks.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "ks",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'jd'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsjd.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "jd",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'xhs'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"        => "fsxpt.fengsutb.com",
-                "Origin"      => "https://fx.fengsutb.com",
-                "platform"    => "xhs",
-                "Pragma"      => "no-cache",
-                "Referer"     => "https://fx.fengsutb.com/",
-                "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ]
-        ];
-        return $header[$key] ?? [];
-    }
 
 
 }

+ 30 - 150
app/admin/command/TaskKs.php

@@ -29,6 +29,32 @@ use GuzzleHttp\Psr7\Request;
 //快手
 class TaskKs extends Command
 {
+    
+    protected $url = 'https://fsks.fengsutb.com/amount/ship-list-new';
+
+    protected $headers = [
+        'Accept'=> "application/json, text/plain, */*",
+        'Accept-Encoding'=> "gzip, deflate, br, zstd",
+        'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+        "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
+        "Cache-Control"=> "no-cache",
+        'Connection'   => 'keep-alive',
+        "Content-Type"=> "application/json",
+        "Host"      => "fsks.fengsutb.com",
+        "Origin"    => "https://fx.fengsutb.com",
+        "platform" => "ks",
+        "Pragma"=> "no-cache",
+        "Referer"=> "https://fx.fengsutb.com/",
+        "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
+        "Sec-ch-ua-Mobile"=> "?0",
+        "Sec-ch-ua-platform"=> "Windows",
+        "Sec-Fetch-Dest" => "empty",
+        "Sec-Fetch-Mode" => "cors",
+        "Sec-Fetch-Site" => "same-site",
+        "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
+    ];
+    
+    
     // 指令配置
     protected function configure()
     {
@@ -39,7 +65,7 @@ class TaskKs extends Command
     protected function execute(Input $input, Output $output)
     {
         $client = new Client([ 'verify' => false]);
-        $last_time = CrontabLog::getLastRunTime(0);
+        $last_time = CrontabLog::getLastRunTime(3);
         $body = '{
         "goodType": 2,
         "goodsFlag": 1,
@@ -54,7 +80,7 @@ class TaskKs extends Command
         "timeType": 2,
         "tradeStatus": 2
         }';
-        $request = new Request('POST', $this->getUrl('dy'), $this->getHeaders('dy'), $body);
+        $request = new Request('POST', $this->url, $this->headers, $body);
         $res = $client->sendAsync($request)->wait();
         if($res->getStatusCode() == 200) {
             $data = json_decode($res->getBody()->getContents(), true);  
@@ -92,10 +118,7 @@ class TaskKs extends Command
             // 保存到数据库
             (new FengsuShip())->saveAll($queue);
             // 更新最后执行时间
-            CrontabLog::create([
-                'type_id' => 0,
-                'last_time' => date('Y-m-d H:i:s'),
-            ]);
+            CrontabLog::create(['type_id' => 3,'last_time' => date('Y-m-d H:i:s')]);
         }
 
         // 指令输出
@@ -103,150 +126,7 @@ class TaskKs extends Command
     }
 
 
-    //获取请求url
-    protected function getUrl(string $key):string
-    {
-        $url = [
-            'tb'  => 'https://fszntb.zhifeiyun.cn/amount/ship-list-new', //淘宝
-            'pdd' => 'https://fsfxpdd.fengsutb.com/amount/ship-list-new', //拼多多
-            'dy'  => 'https://fsdy2.fengsutb.com/amount/ship-list-new', //抖音
-            'ks'  => 'https://fsks.fengsutb.com/amount/ship-list-new',   //快手
-            'jd'  => 'https://fsjd.fengsutb.com/amount/ship-list-new', //京东
-            'xhs' => 'https://fsxpt.fengsutb.com/amount/ship-list-new', //小红书
-        ];
-        return $url[$key] ?? $url['tb'];
-    }
-
-    //获取头部
-    protected function getHeaders(string $key):array{
-        $header = [
-            'tb' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "tb",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'pdd' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "pdd",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
-                'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
-                'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
-            ],
-            'dy'=> [
-                'Host' => 'fsdy2.fengsutb.com',
-                'Connection' => 'keep-alive',
-                'sec-ch-ua-platform' => 'Windows',
-                'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
-                'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                'sec-ch-ua-mobile' => '?0',
-                'doudian-event-id' => '1757940551000163',
-                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
-                'Accept' => 'application/json, text/plain, */*',
-                'platform' => 'dy',
-                'Origin' => 'https://fx.fengsutb.com',
-                'Sec-Fetch-Site' => 'same-site',
-                'Sec-Fetch-Mode' => 'cors',
-                'Sec-Fetch-Dest' => 'empty',
-                'Referer' => 'https://fx.fengsutb.com/',
-                'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
-                'Content-Type' => 'application/json',
-            ],
-            'ks'=> [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsks.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "ks",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'jd'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsjd.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "jd",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'xhs'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"        => "fsxpt.fengsutb.com",
-                "Origin"      => "https://fx.fengsutb.com",
-                "platform"    => "xhs",
-                "Pragma"      => "no-cache",
-                "Referer"     => "https://fx.fengsutb.com/",
-                "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ]
-        ];
-        return $header[$key] ?? [];
-    }
+ 
 
 
 }

+ 34 - 149
app/admin/command/TaskPdd.php

@@ -30,6 +30,35 @@ use GuzzleHttp\Psr7\Request;
 //拼多多
 class TaskPdd extends Command
 {
+    
+    //拼多多请求地址
+    protected $url = 'https://fsfxpdd.fengsutb.com/amount/ship-list-new';
+
+    //拼多多请求头部
+    protected $headers = [
+        'Accept'=> "application/json, text/plain, */*",
+        'Accept-Encoding'=> "gzip, deflate, br, zstd",
+        'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+        "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
+        "Cache-Control"=> "no-cache",
+        "Content-Type"=> "application/json",
+        "Origin"=> "https://fx.fengsutb.com",
+        "platform" => "pdd",
+        "Pragma"=> "no-cache",
+        "priority" => "u=1, i",
+        "Referer"=> "https://fx.fengsutb.com/",
+        "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
+        "Sec-ch-ua-Mobile"=> "?0",
+        "Sec-ch-ua-platform"=> "Windows",
+        "Sec-Fetch-Dest" => "empty",
+        "Sec-Fetch-Mode" => "cors",
+        "Sec-Fetch-Site" => "same-site",
+        "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
+        'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
+        'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
+    ];
+    
+    
     // 指令配置
     protected function configure()
     {
@@ -40,7 +69,7 @@ class TaskPdd extends Command
     protected function execute(Input $input, Output $output)
     {
         $client = new Client([ 'verify' => false]);
-        $last_time = CrontabLog::getLastRunTime(0);
+        $last_time = CrontabLog::getLastRunTime(1);
         $body = '{
         "goodType": 2,
         "goodsFlag": 1,
@@ -55,7 +84,7 @@ class TaskPdd extends Command
         "timeType": 2,
         "tradeStatus": 2
         }';
-        $request = new Request('POST', $this->getUrl('dy'), $this->getHeaders('dy'), $body);
+        $request = new Request('POST', $this->url, $this->headers, $body);
         $res = $client->sendAsync($request)->wait();
         if($res->getStatusCode() == 200) {
             $data = json_decode($res->getBody()->getContents(), true);  
@@ -93,10 +122,7 @@ class TaskPdd extends Command
             // 保存到数据库
             (new FengsuShip())->saveAll($queue);
             // 更新最后执行时间
-            CrontabLog::create([
-                'type_id' => 0,
-                'last_time' => date('Y-m-d H:i:s'),
-            ]);
+            CrontabLog::create(['type_id' => 1,'last_time' => date('Y-m-d H:i:s')]);
         }
 
         // 指令输出
@@ -104,150 +130,9 @@ class TaskPdd extends Command
     }
 
 
-    //获取请求url
-    protected function getUrl(string $key):string
-    {
-        $url = [
-            'tb'  => 'https://fszntb.zhifeiyun.cn/amount/ship-list-new', //淘宝
-            'pdd' => 'https://fsfxpdd.fengsutb.com/amount/ship-list-new', //拼多多
-            'dy'  => 'https://fsdy2.fengsutb.com/amount/ship-list-new', //抖音
-            'ks'  => 'https://fsks.fengsutb.com/amount/ship-list-new',   //快手
-            'jd'  => 'https://fsjd.fengsutb.com/amount/ship-list-new', //京东
-            'xhs' => 'https://fsxpt.fengsutb.com/amount/ship-list-new', //小红书
-        ];
-        return $url[$key] ?? $url['tb'];
-    }
 
-    //获取头部
-    protected function getHeaders(string $key):array{
-        $header = [
-            'tb' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "tb",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'pdd' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "pdd",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
-                'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
-                'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
-            ],
-            'dy'=> [
-                'Host' => 'fsdy2.fengsutb.com',
-                'Connection' => 'keep-alive',
-                'sec-ch-ua-platform' => 'Windows',
-                'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
-                'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                'sec-ch-ua-mobile' => '?0',
-                'doudian-event-id' => '1757940551000163',
-                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
-                'Accept' => 'application/json, text/plain, */*',
-                'platform' => 'dy',
-                'Origin' => 'https://fx.fengsutb.com',
-                'Sec-Fetch-Site' => 'same-site',
-                'Sec-Fetch-Mode' => 'cors',
-                'Sec-Fetch-Dest' => 'empty',
-                'Referer' => 'https://fx.fengsutb.com/',
-                'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
-                'Content-Type' => 'application/json',
-            ],
-            'ks'=> [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsks.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "ks",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'jd'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsjd.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "jd",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'xhs'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"        => "fsxpt.fengsutb.com",
-                "Origin"      => "https://fx.fengsutb.com",
-                "platform"    => "xhs",
-                "Pragma"      => "no-cache",
-                "Referer"     => "https://fx.fengsutb.com/",
-                "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ]
-        ];
-        return $header[$key] ?? [];
-    }
+
+
 
 
 }

+ 30 - 151
app/admin/command/TaskTb.php

@@ -29,6 +29,33 @@ use GuzzleHttp\Psr7\Request;
 //淘宝
 class TaskTb extends Command
 {
+   
+    //淘宝请求地址
+    protected $url = 'https://fszntb.zhifeiyun.cn/amount/ship-list-new';
+
+    //请求头部
+    protected $headers = [
+            'Accept'=> "application/json, text/plain, */*",
+            'Accept-Encoding'=> "gzip, deflate, br, zstd",
+            'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+            "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
+            "Cache-Control"=> "no-cache",
+            "Content-Type"=> "application/json",
+            "Origin"=> "https://fx.fengsutb.com",
+            "platform" => "tb",
+            "Pragma"=> "no-cache",
+            "priority" => "u=1, i",
+            "Referer"=> "https://fx.fengsutb.com/",
+            "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
+            "Sec-ch-ua-Mobile"=> "?0",
+            "Sec-ch-ua-platform"=> "Windows",
+            "Sec-Fetch-Dest" => "empty",
+            "Sec-Fetch-Mode" => "cors",
+            "Sec-Fetch-Site" => "same-site",
+            "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
+    ];
+    
+   
     // 指令配置
     protected function configure()
     {
@@ -54,7 +81,7 @@ class TaskTb extends Command
         "timeType": 2,
         "tradeStatus": 2
         }';
-        $request = new Request('POST', $this->getUrl('dy'), $this->getHeaders('dy'), $body);
+        $request = new Request('POST', $this->url, $this->headers, $body);
         $res = $client->sendAsync($request)->wait();
         if($res->getStatusCode() == 200) {
             $data = json_decode($res->getBody()->getContents(), true);  
@@ -92,161 +119,13 @@ class TaskTb extends Command
             // 保存到数据库
             (new FengsuShip())->saveAll($queue);
             // 更新最后执行时间
-            CrontabLog::create([
-                'type_id' => 0,
-                'last_time' => date('Y-m-d H:i:s'),
-            ]);
+            CrontabLog::create(['type_id' => 0,'last_time' => date('Y-m-d H:i:s')]);
         }
-
         // 指令输出
         $output->writeln('ok');
     }
 
 
-    //获取请求url
-    protected function getUrl(string $key):string
-    {
-        $url = [
-            'tb'  => 'https://fszntb.zhifeiyun.cn/amount/ship-list-new', //淘宝
-            'pdd' => 'https://fsfxpdd.fengsutb.com/amount/ship-list-new', //拼多多
-            'dy'  => 'https://fsdy2.fengsutb.com/amount/ship-list-new', //抖音
-            'ks'  => 'https://fsks.fengsutb.com/amount/ship-list-new',   //快手
-            'jd'  => 'https://fsjd.fengsutb.com/amount/ship-list-new', //京东
-            'xhs' => 'https://fsxpt.fengsutb.com/amount/ship-list-new', //小红书
-        ];
-        return $url[$key] ?? $url['tb'];
-    }
-
-    //获取头部
-    protected function getHeaders(string $key):array{
-        $header = [
-            'tb' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "tb",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'pdd' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "pdd",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
-                'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
-                'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
-            ],
-            'dy'=> [
-                'Host' => 'fsdy2.fengsutb.com',
-                'Connection' => 'keep-alive',
-                'sec-ch-ua-platform' => 'Windows',
-                'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
-                'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                'sec-ch-ua-mobile' => '?0',
-                'doudian-event-id' => '1757940551000163',
-                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
-                'Accept' => 'application/json, text/plain, */*',
-                'platform' => 'dy',
-                'Origin' => 'https://fx.fengsutb.com',
-                'Sec-Fetch-Site' => 'same-site',
-                'Sec-Fetch-Mode' => 'cors',
-                'Sec-Fetch-Dest' => 'empty',
-                'Referer' => 'https://fx.fengsutb.com/',
-                'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
-                'Content-Type' => 'application/json',
-            ],
-            'ks'=> [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsks.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "ks",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'jd'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsjd.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "jd",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'xhs'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"        => "fsxpt.fengsutb.com",
-                "Origin"      => "https://fx.fengsutb.com",
-                "platform"    => "xhs",
-                "Pragma"      => "no-cache",
-                "Referer"     => "https://fx.fengsutb.com/",
-                "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ]
-        ];
-        return $header[$key] ?? [];
-    }
-
+  
 
 }

+ 29 - 151
app/admin/command/TaskXhs.php

@@ -30,6 +30,32 @@ use GuzzleHttp\Psr7\Request;
 // 小红书
 class TaskXhs extends Command
 {
+    
+    protected $url = 'https://fsxpt.fengsutb.com/amount/ship-list-new';
+
+    protected $headers = [
+            'Accept'=> "application/json, text/plain, */*",
+            'Accept-Encoding'=> "gzip, deflate, br, zstd",
+            'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+            "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
+            "Cache-Control"=> "no-cache",
+            'Connection'   => 'keep-alive',
+            "Content-Type"=> "application/json",
+            "Host"        => "fsxpt.fengsutb.com",
+            "Origin"      => "https://fx.fengsutb.com",
+            "platform"    => "xhs",
+            "Pragma"      => "no-cache",
+            "Referer"     => "https://fx.fengsutb.com/",
+            "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
+            "Sec-ch-ua-Mobile"=> "?0",
+            "Sec-ch-ua-platform"=> "Windows",
+            "Sec-Fetch-Dest" => "empty",
+            "Sec-Fetch-Mode" => "cors",
+            "Sec-Fetch-Site" => "same-site",
+            "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
+    ];
+    
+    
     // 指令配置
     protected function configure()
     {
@@ -40,7 +66,7 @@ class TaskXhs extends Command
     protected function execute(Input $input, Output $output)
     {
         $client = new Client([ 'verify' => false]);
-        $last_time = CrontabLog::getLastRunTime(0);
+        $last_time = CrontabLog::getLastRunTime(5);
         $body = '{
         "goodType": 2,
         "goodsFlag": 1,
@@ -55,7 +81,7 @@ class TaskXhs extends Command
         "timeType": 2,
         "tradeStatus": 2
         }';
-        $request = new Request('POST', $this->getUrl('dy'), $this->getHeaders('dy'), $body);
+        $request = new Request('POST', $this->url, $this->headers, $body);
         $res = $client->sendAsync($request)->wait();
         if($res->getStatusCode() == 200) {
             $data = json_decode($res->getBody()->getContents(), true);  
@@ -93,10 +119,7 @@ class TaskXhs extends Command
             // 保存到数据库
             (new FengsuShip())->saveAll($queue);
             // 更新最后执行时间
-            CrontabLog::create([
-                'type_id' => 0,
-                'last_time' => date('Y-m-d H:i:s'),
-            ]);
+            CrontabLog::create(['type_id' => 5,'last_time' => date('Y-m-d H:i:s')]);
         }
 
         // 指令输出
@@ -104,150 +127,5 @@ class TaskXhs extends Command
     }
 
 
-    //获取请求url
-    protected function getUrl(string $key):string
-    {
-        $url = [
-            'tb'  => 'https://fszntb.zhifeiyun.cn/amount/ship-list-new', //淘宝
-            'pdd' => 'https://fsfxpdd.fengsutb.com/amount/ship-list-new', //拼多多
-            'dy'  => 'https://fsdy2.fengsutb.com/amount/ship-list-new', //抖音
-            'ks'  => 'https://fsks.fengsutb.com/amount/ship-list-new',   //快手
-            'jd'  => 'https://fsjd.fengsutb.com/amount/ship-list-new', //京东
-            'xhs' => 'https://fsxpt.fengsutb.com/amount/ship-list-new', //小红书
-        ];
-        return $url[$key] ?? $url['tb'];
-    }
-
-    //获取头部
-    protected function getHeaders(string $key):array{
-        $header = [
-            'tb' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "tb",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'pdd' =>[
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                "Content-Type"=> "application/json",
-                "Origin"=> "https://fx.fengsutb.com",
-                "platform" => "pdd",
-                "Pragma"=> "no-cache",
-                "priority" => "u=1, i",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0",
-                'X-Pdd-Pagecode' => '62f9d7a661b14717564e309aebbb4d47f8988f758f91',
-                'X-Pdd-Pati'     => 'D08NxRGxLLD5hYKZU1nqgE2b9IVrGjdv',
-            ],
-            'dy'=> [
-                'Host' => 'fsdy2.fengsutb.com',
-                'Connection' => 'keep-alive',
-                'sec-ch-ua-platform' => 'Windows',
-                'Authorization' => 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODcwMzg4MzMyMSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTg5NjMwODMsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.ZXaztcUDDlZDgepOqFwaQfzd4RcINNiIv54or0r-b7DJw9aKw7zjH8RmUIE7yqTcyQ_g6r7aGdpn9hf-hIukBg',
-                'sec-ch-ua' => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                'sec-ch-ua-mobile' => '?0',
-                'doudian-event-id' => '1757940551000163',
-                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0',
-                'Accept' => 'application/json, text/plain, */*',
-                'platform' => 'dy',
-                'Origin' => 'https://fx.fengsutb.com',
-                'Sec-Fetch-Site' => 'same-site',
-                'Sec-Fetch-Mode' => 'cors',
-                'Sec-Fetch-Dest' => 'empty',
-                'Referer' => 'https://fx.fengsutb.com/',
-                'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
-                'Content-Type' => 'application/json',
-            ],
-            'ks'=> [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsks.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "ks",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'jd'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"      => "fsjd.fengsutb.com",
-                "Origin"    => "https://fx.fengsutb.com",
-                "platform" => "jd",
-                "Pragma"=> "no-cache",
-                "Referer"=> "https://fx.fengsutb.com/",
-                "Sec-ch-ua" => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ],
-            'xhs'  => [
-                'Accept'=> "application/json, text/plain, */*",
-                'Accept-Encoding'=> "gzip, deflate, br, zstd",
-                'Accept-Language'=> "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "Authorization"=> "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZmEiLCJuaWtlIjoi6Zi_5Y-R5rWL6YCfIiwiY3JlYXRlZCI6MTc1ODc5MDI4NDU3OSwiZHBJZCI6MTkxOTQwLCJleHAiOjE3NTkwNDk0ODQsImVuYWJsZWQiOnRydWUsImF1dGhvcml0aWVzIjpbInpodXlvbmdodSJdLCJkcEFjY291bnRJZCI6MTc4MzU3fQ.TuHvPz7Jf0vuYsbrxX9VpyZ2oOrtZ0YzLQJafoX_RV8up1PmtPLfPATBE93_v_1Ig39nODadaTb4aePy3b0hsA",
-                "Cache-Control"=> "no-cache",
-                'Connection'   => 'keep-alive',
-                "Content-Type"=> "application/json",
-                "Host"        => "fsxpt.fengsutb.com",
-                "Origin"      => "https://fx.fengsutb.com",
-                "platform"    => "xhs",
-                "Pragma"      => "no-cache",
-                "Referer"     => "https://fx.fengsutb.com/",
-                "Sec-ch-ua"   => '"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',
-                "Sec-ch-ua-Mobile"=> "?0",
-                "Sec-ch-ua-platform"=> "Windows",
-                "Sec-Fetch-Dest" => "empty",
-                "Sec-Fetch-Mode" => "cors",
-                "Sec-Fetch-Site" => "same-site",
-                "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0"
-            ]
-        ];
-        return $header[$key] ?? [];
-    }
-
 
 }

+ 1 - 1
app/common/model/CrontabLog.php

@@ -16,7 +16,7 @@ class CrontabLog Extends Model
     //  0淘宝 1拼多多 2抖音 3快手 4京东 5小红书
     public static function getLastRunTime(int $type_id): string
     {
-        $last_time = self::where('type_id', $type_id)->value('last_time');
+        $last_time = self::where('type_id', $type_id)->order('id', 'desc')->value('last_time');
         return $last_time ? $last_time : date('Y-m-d H:i:s') ;
     }
 }