TemplateLabel.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
<?php
/**
* @remark :
* @name :TemplateLabel.php
* @author :lyh
* @method :post
* @time :2024/6/3 11:33
*/
namespace App\Console\Commands\TemplateLabel;
use Illuminate\Console\Command;
use App\Models\Template\TemplateLabel as TemplateLabelModel;
class TemplateLabel extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'template_label';
/**
* The console command description.
*
* @var string
*/
protected $description = '设置label';
/**
* @remark :执行脚本
* @name :handle
* @author :lyh
* @method :post
* @time :2024/6/3 11:35
*/
public function handle(){
//清除当前所有最新标签
$labelModel = new TemplateLabelModel();
//获取最近5天左侧的记录
$start_time = now()->subDays(7)->startOfDay()->toDateString();
$end_time = now()->startOfDay()->toDateString();
$info = $labelModel->read(['created_at'=>['between',[$start_time,$end_time]]]);
if($info === false){
return false;
}
//清空所有的最近标签
}
}