作者 lyh

gx

<?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;
}
//清空所有的最近标签
}
}
... ...
... ... @@ -50,7 +50,7 @@ class UpdateProductCategory extends Command
public function handle(){
//获取所有项目
$projectModel = new Project();
$list = $projectModel->list(['id'=>['in',[621]]],'id',['id']);
$list = $projectModel->list(['id'=>['in',[1077]]],'id',['id']);
echo date('Y-m-d H:i:s') . ' start: ' . json_encode($list) . PHP_EOL;
try {
foreach ($list as $v) {
... ...