作者 赵彬吉

update

  1 +<?php
  2 +
  3 +namespace App\Console\Commands;
  4 +
  5 +use App\Helper\Arr;
  6 +use App\Helper\Common;
  7 +use App\Helper\Gpt;
  8 +use App\Helper\Translate;
  9 +use App\Models\Ai\AiCommand;
  10 +use App\Models\Mail\Mail;
  11 +use App\Models\Project\DeployOptimize;
  12 +use App\Models\Project\Project;
  13 +use App\Models\Project\ProjectUpdateTdk;
  14 +use App\Models\User\User;
  15 +use App\Services\ProjectServer;
  16 +use Illuminate\Console\Command;
  17 +use Illuminate\Support\Facades\Cache;
  18 +use Illuminate\Support\Facades\DB;
  19 +use Illuminate\Support\Facades\Redis;
  20 +
  21 +/**
  22 + * 初始化项目
  23 + * Class InitProject
  24 + * @package App\Console\Commands
  25 + * @author zbj
  26 + * @date 2023/10/8
  27 + */
  28 +class UpdateSeoTdkCrontab extends Command
  29 +{
  30 + /**
  31 + * The name and signature of the console command.
  32 + *
  33 + * @var string
  34 + */
  35 + protected $signature = 'update_seo_tdk_crontab';
  36 +
  37 + /**
  38 + * The console command description.
  39 + *
  40 + * @var string
  41 + */
  42 + protected $description = '一键生成tdk';
  43 +
  44 + /**
  45 + * @return bool
  46 + */
  47 + public function handle()
  48 + {
  49 + $project_ids = Project::where('type', Project::TYPE_TWO)->pluck('id')->toArray();
  50 + foreach ($project_ids as $project_id){
  51 + ProjectUpdateTdk::add_task($project_id);
  52 + }
  53 + }
  54 +
  55 +}
@@ -37,6 +37,7 @@ class Kernel extends ConsoleKernel @@ -37,6 +37,7 @@ class Kernel extends ConsoleKernel
37 $schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次 37 $schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次
38 $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息 38 $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息
39 $schedule->command('update_progress')->everyThirtyMinutes()->withoutOverlapping(1);//监控更新 39 $schedule->command('update_progress')->everyThirtyMinutes()->withoutOverlapping(1);//监控更新
  40 + $schedule->command('update_seo_tdk_crontab')->dailyAt('00:00')->withoutOverlapping(1); //更新上线项目TDK
40 } 41 }
41 42
42 /** 43 /**