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