完成内置的数据库日志驱动;内置数据库日志的定时清除;更新新的数据库sql;

This commit is contained in:
2022-04-03 15:29:06 +08:00
parent dc1b3d4ab4
commit 2a97375418
12 changed files with 487 additions and 390 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace app\tools\controller\timer;
use app\common\controller\TimerController;
use think\facade\Db;
use think\facade\Log;
use think\Request;
class ClearLog extends TimerController
{
protected $frequency = 600;
public function do()
{
Log::debug('清除3天的日志');
Db::name('debug_log')->where('create_time', '<', time() - 60 * 60 * 24 * 3)->delete();
return 'success';
}
}