From 617cca0ddaeff5222abd23bac2dd6f7168d132bb Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sat, 26 Jan 2019 11:53:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=90=9C=E7=B4=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=B7=AF=E5=BE=84=E5=92=8CIP=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/model/system/SystemLog.php | 8 ++++---- application/admin/view/system/system_log/index.php | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/application/admin/model/system/SystemLog.php b/application/admin/model/system/SystemLog.php index 5c4ea633..59fdddfd 100644 --- a/application/admin/model/system/SystemLog.php +++ b/application/admin/model/system/SystemLog.php @@ -84,6 +84,8 @@ class SystemLog extends ModelBasic $model = new self; $model = $model->alias('l'); if($where['pages'] !== '') $model = $model->where('l.page','LIKE',"%$where[pages]%"); + if($where['path'] !== '') $model = $model->where('l.path','LIKE',"%$where[path]%"); + if($where['ip'] !== '') $model = $model->where('l.ip','LIKE',"%$where[ip]%"); if($where['admin_id'] != '') $adminIds = $where['admin_id']; else @@ -99,13 +101,11 @@ class SystemLog extends ModelBasic return self::page($model,$where); } /** - * @day * 删除超过90天的日志 */ - public static function deleteLog($day = 90){ + public static function deleteLog(){ $model = new self; - $times = $day*86400; - $model->where('add_time','<',time()-$times); + $model->where('add_time','<',time()-7776000); $model->delete(); } } \ No newline at end of file diff --git a/application/admin/view/system/system_log/index.php b/application/admin/view/system/system_log/index.php index 9da2825c..2d657033 100644 --- a/application/admin/view/system/system_log/index.php +++ b/application/admin/view/system/system_log/index.php @@ -24,6 +24,12 @@
+
+
+ +
+
+
@@ -42,6 +48,7 @@ 操作时间 + {volist name="list" id="vo"}