正在显示
1 个修改的文件
包含
28 行增加
和
2 行删除
| @@ -4,12 +4,16 @@ namespace App\Console\Commands\Tdk; | @@ -4,12 +4,16 @@ namespace App\Console\Commands\Tdk; | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | use App\Helper\Arr; | 6 | use App\Helper\Arr; |
| 7 | +use App\Models\Blog\BlogCategory; | ||
| 8 | +use App\Models\CustomModule\CustomModuleCategory; | ||
| 7 | use App\Models\News\News; | 9 | use App\Models\News\News; |
| 8 | use App\Models\News\NewsCategory; | 10 | use App\Models\News\NewsCategory; |
| 11 | +use App\Models\Product\Category; | ||
| 9 | use App\Models\Product\Keyword; | 12 | use App\Models\Product\Keyword; |
| 10 | use App\Models\Project\KeywordPrefix; | 13 | use App\Models\Project\KeywordPrefix; |
| 11 | use App\Models\Project\Project; | 14 | use App\Models\Project\Project; |
| 12 | use App\Models\Project\ProjectUpdateTdk; | 15 | use App\Models\Project\ProjectUpdateTdk; |
| 16 | +use App\Models\Template\BCustomTemplate; | ||
| 13 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 14 | use App\Utils\LogUtils; | 18 | use App\Utils\LogUtils; |
| 15 | use Illuminate\Console\Command; | 19 | use Illuminate\Console\Command; |
| @@ -55,11 +59,14 @@ class RerunSeoTdk extends Command | @@ -55,11 +59,14 @@ class RerunSeoTdk extends Command | ||
| 55 | */ | 59 | */ |
| 56 | public function handle() | 60 | public function handle() |
| 57 | { | 61 | { |
| 58 | - $project_ids = Project::where('type', Project::TYPE_TWO)->pluck('id')->toArray(); | 62 | + $where = [ |
| 63 | + 'id' => 624 | ||
| 64 | + ]; | ||
| 65 | + $project_ids = Project::where('type', Project::TYPE_TWO)->where($where)->pluck('id')->toArray(); | ||
| 59 | foreach ($project_ids as $project_id){ | 66 | foreach ($project_ids as $project_id){ |
| 60 | try { | 67 | try { |
| 61 | ProjectServer::useProject($project_id); | 68 | ProjectServer::useProject($project_id); |
| 62 | - $this->judgeAnomalies($project_id); | 69 | + $this->changeCompanyName($project_id); |
| 63 | DB::disconnect('custom_mysql'); | 70 | DB::disconnect('custom_mysql'); |
| 64 | }catch (\Exception $e){ | 71 | }catch (\Exception $e){ |
| 65 | dump($e->getMessage()); | 72 | dump($e->getMessage()); |
| @@ -68,6 +75,25 @@ class RerunSeoTdk extends Command | @@ -68,6 +75,25 @@ class RerunSeoTdk extends Command | ||
| 68 | } | 75 | } |
| 69 | 76 | ||
| 70 | /** | 77 | /** |
| 78 | + * 换了公司英文名的 | ||
| 79 | + * @author zbj | ||
| 80 | + * @date 2025/7/18 | ||
| 81 | + */ | ||
| 82 | + public function changeCompanyName($project_id){ | ||
| 83 | + $row1 = BCustomTemplate::where('description', 'like', '%BlueQ Biotechnology%')->update(['description' => '']); | ||
| 84 | + $row2 = Category::where('seo_des', 'like', '%BlueQ Biotechnology%')->update(['seo_des' => '']); | ||
| 85 | + $row3 = Keyword::where('seo_description', 'like', '%BlueQ Biotechnology%')->update(['seo_description' => '']); | ||
| 86 | + $row4 = Keyword::where('keyword_content', 'like', '%BlueQ Biotechnology%')->update(['keyword_content' => '']); | ||
| 87 | + $row5 = BlogCategory::where('seo_des', 'like', '%BlueQ Biotechnology%')->update(['seo_des' => '']); | ||
| 88 | + $row6 = NewsCategory::where('seo_des', 'like', '%BlueQ Biotechnology%')->update(['seo_des' => '']); | ||
| 89 | + $row7 = CustomModuleCategory::where('seo_description', 'like', '%BlueQ Biotechnology%')->update(['seo_description' => '']); | ||
| 90 | + | ||
| 91 | + | ||
| 92 | + dump($row1,$row2,$row3,$row4,$row5,$row6,$row7); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + | ||
| 96 | + /** | ||
| 71 | * 判断seo_title 前缀有wholesale或cheap或buy的词,后缀也有 manufacturer,factory,exporter,company | 97 | * 判断seo_title 前缀有wholesale或cheap或buy的词,后缀也有 manufacturer,factory,exporter,company |
| 72 | * 判断关键词最后一个词是前缀的词,前后缀都不拼 | 98 | * 判断关键词最后一个词是前缀的词,前后缀都不拼 |
| 73 | * @author zbj | 99 | * @author zbj |
-
请 注册 或 登录 后发表评论