Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
5 个修改的文件
包含
31 行增加
和
17 行删除
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | namespace App\Console\Commands\DeleteTemplate; | 10 | namespace App\Console\Commands\DeleteTemplate; |
| 11 | 11 | ||
| 12 | use App\Models\Project\Project; | 12 | use App\Models\Project\Project; |
| 13 | +use App\Models\Template\BTemplateLog; | ||
| 13 | use App\Services\ProjectServer; | 14 | use App\Services\ProjectServer; |
| 14 | use Illuminate\Console\Command; | 15 | use Illuminate\Console\Command; |
| 15 | use Illuminate\Support\Facades\DB; | 16 | use Illuminate\Support\Facades\DB; |
| @@ -46,6 +47,7 @@ class TemplateLog extends Command | @@ -46,6 +47,7 @@ class TemplateLog extends Command | ||
| 46 | foreach ($list as $v){ | 47 | foreach ($list as $v){ |
| 47 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 48 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 48 | ProjectServer::useProject($v['id']); | 49 | ProjectServer::useProject($v['id']); |
| 50 | + $this->deleteTemplate(); | ||
| 49 | DB::disconnect('custom_mysql'); | 51 | DB::disconnect('custom_mysql'); |
| 50 | } | 52 | } |
| 51 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 53 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -59,6 +61,9 @@ class TemplateLog extends Command | @@ -59,6 +61,9 @@ class TemplateLog extends Command | ||
| 59 | * @time :2024/7/10 14:48 | 61 | * @time :2024/7/10 14:48 |
| 60 | */ | 62 | */ |
| 61 | public function deleteTemplate(){ | 63 | public function deleteTemplate(){ |
| 62 | - $templateLogModel = new TemplateLog(); | 64 | + $startDate = date("Y-m-01 00:00:00"); |
| 65 | + $endDate = date("Y-m-t 23:59:59"); | ||
| 66 | + $templateLogModel = new BTemplateLog(); | ||
| 67 | + return $templateLogModel->del(['created_at'=>['not between'=>[$startDate,$endDate]]]); | ||
| 63 | } | 68 | } |
| 64 | } | 69 | } |
| @@ -16,9 +16,11 @@ use App\Models\Product\Keyword; | @@ -16,9 +16,11 @@ use App\Models\Product\Keyword; | ||
| 16 | use App\Models\Product\Product; | 16 | use App\Models\Product\Product; |
| 17 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 18 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 19 | +use Illuminate\Support\Facades\Cache; | ||
| 19 | use Illuminate\Support\Facades\DB; | 20 | use Illuminate\Support\Facades\DB; |
| 20 | use Illuminate\Support\Facades\Http; | 21 | use Illuminate\Support\Facades\Http; |
| 21 | use Illuminate\Support\Facades\Log; | 22 | use Illuminate\Support\Facades\Log; |
| 23 | +use Illuminate\Support\Facades\Redis; | ||
| 22 | 24 | ||
| 23 | class VideoTask extends Command | 25 | class VideoTask extends Command |
| 24 | { | 26 | { |
| @@ -50,7 +52,7 @@ class VideoTask extends Command | @@ -50,7 +52,7 @@ class VideoTask extends Command | ||
| 50 | * @var int 最大子任务 | 52 | * @var int 最大子任务 |
| 51 | */ | 53 | */ |
| 52 | public $max_sub_task = 200; | 54 | public $max_sub_task = 200; |
| 53 | - | 55 | + public $max_num; |
| 54 | /** | 56 | /** |
| 55 | * @return bool | 57 | * @return bool |
| 56 | */ | 58 | */ |
| @@ -48,15 +48,14 @@ class Demo extends Command | @@ -48,15 +48,14 @@ class Demo extends Command | ||
| 48 | protected $description = 'demo'; | 48 | protected $description = 'demo'; |
| 49 | 49 | ||
| 50 | public function handle(){ | 50 | public function handle(){ |
| 51 | - $p = new PurchaserInfo(); | ||
| 52 | - $lists = $p->list(); | ||
| 53 | - foreach ($lists as $k => $v){ | ||
| 54 | - $info = $p->read(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer']]); | ||
| 55 | - if($info === false){ | ||
| 56 | - continue; | ||
| 57 | - } | ||
| 58 | - $p->del(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer'],'id'=>['!=',$v['id']]]); | ||
| 59 | - } | ||
| 60 | - return true; | 51 | + $this->synchronizationFile('/upload/p/1720/file/2024-07/4d.mp4'); |
| 52 | + } | ||
| 53 | + | ||
| 54 | + public function synchronizationFile($path_name){ | ||
| 55 | + //同步到大文件 | ||
| 56 | + $file_path = config('filesystems.disks.cos')['cdn1'].$path_name; | ||
| 57 | + $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME); | ||
| 58 | + $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php'; | ||
| 59 | + return shell_exec($cmd); | ||
| 61 | } | 60 | } |
| 62 | } | 61 | } |
| @@ -361,15 +361,20 @@ class ProjectUpdate extends Command | @@ -361,15 +361,20 @@ class ProjectUpdate extends Command | ||
| 361 | 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'), | 361 | 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'), |
| 362 | 'sort' => $item['sort'] ?? 0, | 362 | 'sort' => $item['sort'] ?? 0, |
| 363 | ], ['id' => $id]); | 363 | ], ['id' => $id]); |
| 364 | + }else{ | ||
| 365 | + //按6.0展示只更新分类 | ||
| 366 | + $model->edit([ | ||
| 367 | + 'category_id' => $category_id | ||
| 368 | + ], ['id' => $id]); | ||
| 364 | } | 369 | } |
| 365 | } | 370 | } |
| 366 | 371 | ||
| 367 | - if ($six_read) { | ||
| 368 | - //关联分类 | ||
| 369 | - if ($category_arr) { | ||
| 370 | - CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); | ||
| 371 | - } | 372 | + //关联分类 |
| 373 | + if ($category_arr) { | ||
| 374 | + CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); | ||
| 375 | + } | ||
| 372 | 376 | ||
| 377 | + if ($six_read) { | ||
| 373 | //扩展字段 | 378 | //扩展字段 |
| 374 | if ($item['extend'] ?? []) { | 379 | if ($item['extend'] ?? []) { |
| 375 | foreach (array_reverse($item['extend']) as $ke => $ve) { | 380 | foreach (array_reverse($item['extend']) as $ke => $ve) { |
| @@ -35,6 +35,9 @@ class Kernel extends ConsoleKernel | @@ -35,6 +35,9 @@ class Kernel extends ConsoleKernel | ||
| 35 | $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 | 35 | $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 |
| 36 | $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 | 36 | $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 |
| 37 | $schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1); | 37 | $schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1); |
| 38 | + // 每月15号执行任务 | ||
| 39 | + $schedule->command('delete_template_log')->monthlyOn(15, '00:01')->withoutOverlapping(); | ||
| 40 | + $schedule->command('update_video_number')->monthlyOn(13, '00:01')->withoutOverlapping(); | ||
| 38 | // 每日推送已完成视频任务项目生成对应界面 | 41 | // 每日推送已完成视频任务项目生成对应界面 |
| 39 | $schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1); | 42 | $schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1); |
| 40 | } | 43 | } |
-
请 注册 或 登录 后发表评论