正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
| @@ -49,8 +49,6 @@ class RankData extends BaseCommands | @@ -49,8 +49,6 @@ class RankData extends BaseCommands | ||
| 49 | } | 49 | } |
| 50 | foreach ($list as $item){ | 50 | foreach ($list as $item){ |
| 51 | $model = GoogleRankModel::where('project_id', $item['project_id'])->where('lang', '')->first(); | 51 | $model = GoogleRankModel::where('project_id', $item['project_id'])->where('lang', '')->first(); |
| 52 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('2222'.$model->updated_date, true) . PHP_EOL, FILE_APPEND); | ||
| 53 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('2222'.date('Y-m-d'), true) . PHP_EOL, FILE_APPEND); | ||
| 54 | if (!$model || $model->updated_date != date('Y-m-d')) { | 52 | if (!$model || $model->updated_date != date('Y-m-d')) { |
| 55 | $res = $api->getGoogleRank($item['api_no']); | 53 | $res = $api->getGoogleRank($item['api_no']); |
| 56 | if(!$res){ | 54 | if(!$res){ |
| @@ -59,6 +57,8 @@ class RankData extends BaseCommands | @@ -59,6 +57,8 @@ class RankData extends BaseCommands | ||
| 59 | } | 57 | } |
| 60 | //收录数 | 58 | //收录数 |
| 61 | $indexed_pages_num = $site_res[$item['api_no']] ?? 0; | 59 | $indexed_pages_num = $site_res[$item['api_no']] ?? 0; |
| 60 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('测试-----333', true) . PHP_EOL, FILE_APPEND); | ||
| 61 | + | ||
| 62 | $this->save_rank($item['project_id'], $res, $indexed_pages_num); | 62 | $this->save_rank($item['project_id'], $res, $indexed_pages_num); |
| 63 | } | 63 | } |
| 64 | //有小语种的 | 64 | //有小语种的 |
| @@ -94,6 +94,7 @@ class RankData extends BaseCommands | @@ -94,6 +94,7 @@ class RankData extends BaseCommands | ||
| 94 | * @date 2023/5/8 | 94 | * @date 2023/5/8 |
| 95 | */ | 95 | */ |
| 96 | public function save_rank($project_id, $data, int $indexed_pages_num = 0, string $lang = ''){ | 96 | public function save_rank($project_id, $data, int $indexed_pages_num = 0, string $lang = ''){ |
| 97 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('44444444444进入', true) . PHP_EOL, FILE_APPEND); | ||
| 97 | $without_project_ids = []; //不用处理排名的项目 | 98 | $without_project_ids = []; //不用处理排名的项目 |
| 98 | 99 | ||
| 99 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; | 100 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; |
-
请 注册 或 登录 后发表评论