UpdateSeoTdkCrontab.php 866 字节
<?php

namespace App\Console\Commands;

use App\Models\Project\Project;
use App\Models\Project\ProjectUpdateTdk;
use Illuminate\Console\Command;

/**
 * 初始化项目
 * 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);
        }
    }

}