作者 Your Name
... ... @@ -10,6 +10,7 @@
namespace App\Console\Commands\DeleteTemplate;
use App\Models\Project\Project;
use App\Models\Template\BTemplateLog;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -46,6 +47,7 @@ class TemplateLog extends Command
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->deleteTemplate();
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
... ... @@ -59,6 +61,9 @@ class TemplateLog extends Command
* @time :2024/7/10 14:48
*/
public function deleteTemplate(){
$templateLogModel = new TemplateLog();
$startDate = date("Y-m-01 00:00:00");
$endDate = date("Y-m-t 23:59:59");
$templateLogModel = new BTemplateLog();
return $templateLogModel->del(['created_at'=>['not between'=>[$startDate,$endDate]]]);
}
}
... ...
... ... @@ -16,9 +16,11 @@ use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;
class VideoTask extends Command
{
... ... @@ -50,7 +52,7 @@ class VideoTask extends Command
* @var int 最大子任务
*/
public $max_sub_task = 200;
public $max_num;
/**
* @return bool
*/
... ...
... ... @@ -48,15 +48,14 @@ class Demo extends Command
protected $description = 'demo';
public function handle(){
$p = new PurchaserInfo();
$lists = $p->list();
foreach ($lists as $k => $v){
$info = $p->read(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer']]);
if($info === false){
continue;
}
$p->del(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer'],'id'=>['!=',$v['id']]]);
}
return true;
$this->synchronizationFile('/upload/p/1720/file/2024-07/4d.mp4');
}
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
}
... ...
... ... @@ -361,15 +361,20 @@ class ProjectUpdate extends Command
'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
'sort' => $item['sort'] ?? 0,
], ['id' => $id]);
}else{
//按6.0展示只更新分类
$model->edit([
'category_id' => $category_id
], ['id' => $id]);
}
}
if ($six_read) {
//关联分类
if ($category_arr) {
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
}
//关联分类
if ($category_arr) {
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
}
if ($six_read) {
//扩展字段
if ($item['extend'] ?? []) {
foreach (array_reverse($item['extend']) as $ke => $ve) {
... ...
... ... @@ -35,6 +35,9 @@ class Kernel extends ConsoleKernel
$schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字
$schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
$schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1);
// 每月15号执行任务
$schedule->command('delete_template_log')->monthlyOn(15, '00:01')->withoutOverlapping();
$schedule->command('update_video_number')->monthlyOn(13, '00:01')->withoutOverlapping();
// 每日推送已完成视频任务项目生成对应界面
$schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1);
}
... ...