mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 23:42:48 +08:00
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
24 lines
515 B
PHP
24 lines
515 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace base\tools\controller\timer;
|
|
|
|
use app\common\controller\TimerController;
|
|
use think\facade\Db;
|
|
use think\facade\Log;
|
|
|
|
class ClearLogBase extends TimerController
|
|
{
|
|
protected $frequency = 600;
|
|
|
|
public function do()
|
|
{
|
|
$days = (int) config('timer.clear_log_days', 3);
|
|
Log::debug('清除' . $days . '天的日志');
|
|
Db::name('debug_log')->where('create_time', '<', time() - 60 * 60 * 24 * $days)->delete();
|
|
|
|
return 'success';
|
|
}
|
|
}
|