|
...
|
...
|
@@ -11,6 +11,7 @@ namespace App\Console\Commands\DeleteTemplate; |
|
|
|
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Template\BTemplateLog;
|
|
|
|
use App\Models\User\UserLog;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
...
|
...
|
@@ -48,6 +49,7 @@ class TemplateLog extends Command |
|
|
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
ProjectServer::useProject($v['id']);
|
|
|
|
$this->deleteTemplate();
|
|
|
|
$this->deleteUserLog();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
...
|
...
|
@@ -65,4 +67,17 @@ class TemplateLog extends Command |
|
|
|
$templateLogModel = new BTemplateLog();
|
|
|
|
return $templateLogModel->del(['created_at'=>['<=',$date]]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :清除用户日志
|
|
|
|
* @name :deleteUserLog
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/11/13 16:19
|
|
|
|
*/
|
|
|
|
public function deleteUserLog(){
|
|
|
|
$date = date('Y-m-d H:i:s', strtotime('-60 days'));
|
|
|
|
$userLogModel = new UserLog();
|
|
|
|
return $userLogModel->del(['created_at'=>['<=',$date]]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|