作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -70,7 +70,12 @@ class SyncProject extends Command @@ -70,7 +70,12 @@ class SyncProject extends Command
70 $is_update = $item['data']['is_update']??0;//是否是4.0或5.0更新到6.0 70 $is_update = $item['data']['is_update']??0;//是否是4.0或5.0更新到6.0
71 $order_id = $item['data']['order_id']; 71 $order_id = $item['data']['order_id'];
72 if($is_update == 1){ 72 if($is_update == 1){
73 - $data = http_get('https://quanqiusou.cn/extend_api/v6/update.php?postid='.$order_id, ['charset' => 'UTF-8']); 73 +// $data = http_get('https://quanqiusou.cn/extend_api/v6/update.php?postid='.$order_id, ['charset' => 'UTF-8']);
  74 + $client = new \GuzzleHttp\Client();
  75 + $data = $client->request('GET', 'https://quanqiusou.cn/extend_api/v6/update.php?postid='.$order_id, [
  76 + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
  77 + ])->getBody()->getContents();
  78 + $data = json_decode($data, true);
74 }else{ 79 }else{
75 $api = new OaGlobalsoApi(); 80 $api = new OaGlobalsoApi();
76 $data = $api->order_info($order_id); 81 $data = $api->order_info($order_id);
@@ -64,7 +64,7 @@ class RankData extends BaseCommands @@ -64,7 +64,7 @@ class RankData extends BaseCommands
64 foreach ($list as $item) { 64 foreach ($list as $item) {
65 Log::channel('rank_data')->info('项目开始:ID' . $item['project_id'] .' - '. $item['api_no']) . ''; 65 Log::channel('rank_data')->info('项目开始:ID' . $item['project_id'] .' - '. $item['api_no']) . '';
66 try { 66 try {
67 - (new RankDataLogic())->syncRankData($item['api_no'], $site_res, true); 67 + (new RankDataLogic())->syncRankData($item['api_no'], $site_res);
68 } catch (\Exception $e) { 68 } catch (\Exception $e) {
69 Log::channel('rank_data')->error('RankData:失败 ' . $item['api_no'] . $e->getMessage()); 69 Log::channel('rank_data')->error('RankData:失败 ' . $item['api_no'] . $e->getMessage());
70 $error++; 70 $error++;
@@ -38,7 +38,12 @@ class SyncMobile extends Command @@ -38,7 +38,12 @@ class SyncMobile extends Command
38 */ 38 */
39 public function handle(){ 39 public function handle(){
40 $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php'; 40 $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php';
41 - $data = curlGet($url);//TODO::获取号码库 41 +// $data = curlGet($url);//TODO::获取号码库
  42 + $client = new \GuzzleHttp\Client();
  43 + $data = $client->request('GET', $url, [
  44 + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
  45 + ])->getBody()->getContents();
  46 + $data = json_decode($data, true);
42 DB::table('gl_mobile')->delete(); 47 DB::table('gl_mobile')->delete();
43 $create_time = date('Y-m-d H:i:s'); 48 $create_time = date('Y-m-d H:i:s');
44 foreach ($data as $v){ 49 foreach ($data as $v){
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 namespace App\Helper; 4 namespace App\Helper;
5 5
6 use App\Utils\HttpUtils; 6 use App\Utils\HttpUtils;
  7 +use GuzzleHttp\Client;
7 use GuzzleHttp\Exception\GuzzleException; 8 use GuzzleHttp\Exception\GuzzleException;
8 use Illuminate\Support\Facades\Cache; 9 use Illuminate\Support\Facades\Cache;
9 use Illuminate\Support\Facades\Log; 10 use Illuminate\Support\Facades\Log;
@@ -95,7 +96,12 @@ class QuanqiusouApi @@ -95,7 +96,12 @@ class QuanqiusouApi
95 //8918_kr_2024-02-19_2024-02-25.json 8918_2024-02-19_2024-02-25.json 96 //8918_kr_2024-02-19_2024-02-25.json 8918_2024-02-19_2024-02-25.json
96 $api_url = "https://quanqiusou.cn/google-rank/data_json/{$today}/{$api_no}_{$startDay}_{$endDay}.json"; 97 $api_url = "https://quanqiusou.cn/google-rank/data_json/{$today}/{$api_no}_{$startDay}_{$endDay}.json";
97 try { 98 try {
98 - $res = HttpUtils::get($api_url, []); 99 + //$res = HttpUtils::get($api_url, []);
  100 + $client = new Client();
  101 + $res = $client->request('GET', $api_url, [
  102 + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
  103 + // 其他请求选项
  104 + ])->getBody()->getContents();
99 if($res){ 105 if($res){
100 $res = Arr::s2a($res); 106 $res = Arr::s2a($res);
101 Cache::put($key, $res, 2 * 3600); 107 Cache::put($key, $res, 2 * 3600);
@@ -586,7 +586,11 @@ class RankDataLogic extends BaseLogic @@ -586,7 +586,11 @@ class RankDataLogic extends BaseLogic
586 586
587 //5.0 587 //5.0
588 try { 588 try {
589 - $data = HttpUtils::get("https://www.quanqiusou.cn/semrush-api/data_json/{$api_no}.json", []); 589 +// $data = HttpUtils::get("https://www.quanqiusou.cn/semrush-api/data_json/{$api_no}.json", []);
  590 + $client = new \GuzzleHttp\Client();
  591 + $data = $client->request('GET', "https://www.quanqiusou.cn/semrush-api/data_json/{$api_no}.json", [
  592 + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
  593 + ])->getBody()->getContents();
590 $data = Arr::s2a($data); 594 $data = Arr::s2a($data);
591 }catch (\Exception $e){ 595 }catch (\Exception $e){
592 $data = []; 596 $data = [];
@@ -668,7 +672,11 @@ class RankDataLogic extends BaseLogic @@ -668,7 +672,11 @@ class RankDataLogic extends BaseLogic
668 672
669 //5.0 673 //5.0
670 try { 674 try {
671 - $data = HttpUtils::get("https://www.quanqiusou.cn/semrush-api/data_json/{$api_no}.json", []); 675 +// $data = HttpUtils::get("https://www.quanqiusou.cn/semrush-api/data_json/{$api_no}.json", []);
  676 + $client = new \GuzzleHttp\Client();
  677 + $data = $client->request('GET', "https://www.quanqiusou.cn/semrush-api/data_json/{$api_no}.json", [
  678 + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
  679 + ])->getBody()->getContents();
672 $data = Arr::s2a($data)['list']; 680 $data = Arr::s2a($data)['list'];
673 }catch (\Exception $e){ 681 }catch (\Exception $e){
674 $data = []; 682 $data = [];