|
@@ -11,6 +11,7 @@ namespace App\Console\Commands\DeleteTemplate; |
|
@@ -11,6 +11,7 @@ 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\Models\Template\BTemplateLog;
|
|
|
|
14
|
+use App\Models\User\UserLog;
|
|
14
|
use App\Services\ProjectServer;
|
15
|
use App\Services\ProjectServer;
|
|
15
|
use Illuminate\Console\Command;
|
16
|
use Illuminate\Console\Command;
|
|
16
|
use Illuminate\Support\Facades\DB;
|
17
|
use Illuminate\Support\Facades\DB;
|
|
@@ -48,6 +49,7 @@ class TemplateLog extends Command |
|
@@ -48,6 +49,7 @@ class TemplateLog extends Command |
|
48
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
49
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
49
|
ProjectServer::useProject($v['id']);
|
50
|
ProjectServer::useProject($v['id']);
|
|
50
|
$this->deleteTemplate();
|
51
|
$this->deleteTemplate();
|
|
|
|
52
|
+ $this->deleteUserLog();
|
|
51
|
DB::disconnect('custom_mysql');
|
53
|
DB::disconnect('custom_mysql');
|
|
52
|
}
|
54
|
}
|
|
53
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
55
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
@@ -65,4 +67,17 @@ class TemplateLog extends Command |
|
@@ -65,4 +67,17 @@ class TemplateLog extends Command |
|
65
|
$templateLogModel = new BTemplateLog();
|
67
|
$templateLogModel = new BTemplateLog();
|
|
66
|
return $templateLogModel->del(['created_at'=>['<=',$date]]);
|
68
|
return $templateLogModel->del(['created_at'=>['<=',$date]]);
|
|
67
|
}
|
69
|
}
|
|
|
|
70
|
+
|
|
|
|
71
|
+ /**
|
|
|
|
72
|
+ * @remark :清除用户日志
|
|
|
|
73
|
+ * @name :deleteUserLog
|
|
|
|
74
|
+ * @author :lyh
|
|
|
|
75
|
+ * @method :post
|
|
|
|
76
|
+ * @time :2024/11/13 16:19
|
|
|
|
77
|
+ */
|
|
|
|
78
|
+ public function deleteUserLog(){
|
|
|
|
79
|
+ $date = date('Y-m-d H:i:s', strtotime('-60 days'));
|
|
|
|
80
|
+ $userLogModel = new UserLog();
|
|
|
|
81
|
+ return $userLogModel->del(['created_at'=>['<=',$date]]);
|
|
|
|
82
|
+ }
|
|
68
|
} |
83
|
} |