|
...
|
...
|
@@ -49,8 +49,6 @@ class RankData extends BaseCommands |
|
|
|
}
|
|
|
|
foreach ($list as $item){
|
|
|
|
$model = GoogleRankModel::where('project_id', $item['project_id'])->where('lang', '')->first();
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('2222'.$model->updated_date, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('2222'.date('Y-m-d'), true) . PHP_EOL, FILE_APPEND);
|
|
|
|
if (!$model || $model->updated_date != date('Y-m-d')) {
|
|
|
|
$res = $api->getGoogleRank($item['api_no']);
|
|
|
|
if(!$res){
|
|
...
|
...
|
@@ -59,6 +57,8 @@ class RankData extends BaseCommands |
|
|
|
}
|
|
|
|
//收录数
|
|
|
|
$indexed_pages_num = $site_res[$item['api_no']] ?? 0;
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('测试-----333', true) . PHP_EOL, FILE_APPEND);
|
|
|
|
|
|
|
|
$this->save_rank($item['project_id'], $res, $indexed_pages_num);
|
|
|
|
}
|
|
|
|
//有小语种的
|
|
...
|
...
|
@@ -94,6 +94,7 @@ class RankData extends BaseCommands |
|
|
|
* @date 2023/5/8
|
|
|
|
*/
|
|
|
|
public function save_rank($project_id, $data, int $indexed_pages_num = 0, string $lang = ''){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('44444444444进入', true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$without_project_ids = []; //不用处理排名的项目
|
|
|
|
|
|
|
|
$first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0;
|
...
|
...
|
|