UpdateSeoTdkCrontab.php
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace App\Console\Commands;
use App\Helper\Arr;
use App\Helper\Common;
use App\Helper\Gpt;
use App\Helper\Translate;
use App\Models\Ai\AiCommand;
use App\Models\Mail\Mail;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Project;
use App\Models\Project\ProjectUpdateTdk;
use App\Models\User\User;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
/**
* 初始化项目
* Class InitProject
* @package App\Console\Commands
* @author zbj
* @date 2023/10/8
*/
class UpdateSeoTdkCrontab extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update_seo_tdk_crontab';
/**
* The console command description.
*
* @var string
*/
protected $description = '一键生成tdk';
/**
* @return bool
*/
public function handle()
{
$project_ids = Project::where('type', Project::TYPE_TWO)->pluck('id')->toArray();
foreach ($project_ids as $project_id){
ProjectUpdateTdk::add_task($project_id);
}
}
}