|
...
|
...
|
@@ -141,29 +141,45 @@ class RerunSeoTdk extends Command |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断异常
|
|
|
|
* @author zbj
|
|
|
|
* @date 2025/4/12
|
|
|
|
*/
|
|
|
|
public function judgeAnomalies($project_id){
|
|
|
|
//获取当前项目的所有分类
|
|
|
|
$categories = NewsCategory::pluck('alias', 'id')->toArray();
|
|
|
|
//新闻 seo_keyword 和 分类名一样的
|
|
|
|
$news_ids = [];
|
|
|
|
foreach ($categories as $category){
|
|
|
|
$ids = News::WhereRaw("FIND_IN_SET('{$category}', `seo_keywords`)")->pluck('id')->toArray();
|
|
|
|
$news_ids = array_unique(array_merge($news_ids, $ids));
|
|
|
|
}
|
|
|
|
// /**
|
|
|
|
// * 判断异常
|
|
|
|
// * @author zbj
|
|
|
|
// * @date 2025/4/12
|
|
|
|
// */
|
|
|
|
// public function judgeAnomalies($project_id){
|
|
|
|
// //获取当前项目的所有分类
|
|
|
|
// $categories = NewsCategory::pluck('alias', 'id')->toArray();
|
|
|
|
// //新闻 seo_keyword 和 分类名一样的
|
|
|
|
// $news_ids = [];
|
|
|
|
// foreach ($categories as $category){
|
|
|
|
// $ids = News::WhereRaw("FIND_IN_SET('{$category}', `seo_keywords`)")->pluck('id')->toArray();
|
|
|
|
// $news_ids = array_unique(array_merge($news_ids, $ids));
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// $count = count($news_ids);
|
|
|
|
// if($count){
|
|
|
|
// echo "项目{$project_id},共{$count}条需要重跑";
|
|
|
|
// News::whereIn('id', $news_ids)->update(['seo_keywords' => '']);
|
|
|
|
// ProjectUpdateTdk::add_task($project_id);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
$count = count($news_ids);
|
|
|
|
if($count){
|
|
|
|
echo "项目{$project_id},共{$count}条需要重跑";
|
|
|
|
News::whereIn('id', $news_ids)->update(['seo_keywords' => '']);
|
|
|
|
ProjectUpdateTdk::add_task($project_id);
|
|
|
|
public function judgeAnomalies($project_id)
|
|
|
|
{
|
|
|
|
$page_title = Keyword::where('keyword_title', 'like', '%qz_1%')->orWhere('keyword_title', 'like', '%qz_2%')->update(['keyword_title' => '']);
|
|
|
|
$page_content = Keyword::where('keyword_content', 'like', '%qz_1%')->orWhere('keyword_content', 'like', '%qz_2%')->update(['keyword_content' => '']);
|
|
|
|
$seo_description = Keyword::where('seo_description', 'like', '%qz_1%')->orWhere('seo_description', 'like', '%qz_2%')->update(['seo_description' => '']);
|
|
|
|
|
|
|
|
if($page_title || $page_content || $seo_description){
|
|
|
|
echo "项目{$project_id},需要重跑";
|
|
|
|
dump($page_title);
|
|
|
|
dump($page_content);
|
|
|
|
dump($seo_description);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getAllPrefix($type, int $project_id = 0){
|
|
|
|
$cache_key = 'AllPrefix_' . $type . '_' . $project_id;
|
|
|
|
$data = Cache::get($cache_key);
|
|
...
|
...
|
@@ -173,4 +189,6 @@ class RerunSeoTdk extends Command |
|
|
|
}
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|