作者 lyh
@@ -64,10 +64,11 @@ class RankData extends BaseCommands @@ -64,10 +64,11 @@ class RankData extends BaseCommands
64 return false; 64 return false;
65 } 65 }
66 foreach ($list as $item){ 66 foreach ($list as $item){
  67 + echo $item['api_no'] . PHP_EOL;
67 try { 68 try {
68 (new RankDataLogic())->syncRankData($item['api_no'], $site_res); 69 (new RankDataLogic())->syncRankData($item['api_no'], $site_res);
69 }catch (\Exception $e){ 70 }catch (\Exception $e){
70 - Log::channel('rank_data')->error('RankData:失败 ' . $e->getMessage()); 71 + Log::channel('rank_data')->error('RankData:失败 ' . $item['api_no'] . $e->getMessage());
71 $error++; 72 $error++;
72 continue; 73 continue;
73 } 74 }
@@ -392,7 +392,7 @@ class RankDataLogic extends BaseLogic @@ -392,7 +392,7 @@ class RankDataLogic extends BaseLogic
392 if (!empty($lang_list[$api_no])) { 392 if (!empty($lang_list[$api_no])) {
393 $model = RankData::where('project_id', $project_id)->where('lang', '<>', '')->first(); 393 $model = RankData::where('project_id', $project_id)->where('lang', '<>', '')->first();
394 if (!$model || $model->updated_date != date('Y-m-d') || $force) { 394 if (!$model || $model->updated_date != date('Y-m-d') || $force) {
395 - $res = $api->getGoogleRank($api_no, $model->lang, 7, $force); 395 + $res = $api->getGoogleRank($api_no, $lang_list[$api_no], 7, $force);
396 if (!$res) { 396 if (!$res) {
397 throw new \Exception("接口数据获取失败,api_no:{$api_no},lang"); 397 throw new \Exception("接口数据获取失败,api_no:{$api_no},lang");
398 } 398 }