update request log

This commit is contained in:
2026-03-17 14:17:06 +08:00
parent ccea43d8d6
commit 8f69eb0349
3 changed files with 49 additions and 1 deletions
@@ -29,6 +29,12 @@ class CleanRequestLogsCommand extends HyperfCommand
public function handle(): void
{
$days = (int) $this->input->getOption('days');
if ($days < 1) {
$this->error('保留天数必须大于 0');
return;
}
$cutoff = Carbon::now()->subDays($days);
$deleted = ApiRequestLog::query()