diff --git a/application/admin/controller/system/SystemLog.php b/application/admin/controller/system/SystemLog.php index f27d4134..9fc943e1 100644 --- a/application/admin/controller/system/SystemLog.php +++ b/application/admin/controller/system/SystemLog.php @@ -1 +1 @@ -request); $where['level'] = $this->adminInfo['level']; $this->assign('where',$where); $this->assign('admin',SystemAdmin::getOrdAdmin('id,real_name',$this->adminInfo['level'])); $this->assign(LogModel::systemPage($where)); return $this->fetch(); } } \ No newline at end of file +request); $where['level'] = $this->adminInfo['level']; $this->assign('where',$where); $this->assign('admin',SystemAdmin::getOrdAdmin('id,real_name',$this->adminInfo['level'])); $this->assign(LogModel::systemPage($where)); return $this->fetch(); } } \ No newline at end of file diff --git a/application/admin/model/system/SystemLog.php b/application/admin/model/system/SystemLog.php index 25b7a1c8..5c4ea633 100644 --- a/application/admin/model/system/SystemLog.php +++ b/application/admin/model/system/SystemLog.php @@ -99,11 +99,13 @@ class SystemLog extends ModelBasic return self::page($model,$where); } /** + * @day * 删除超过90天的日志 */ - public static function deleteLog(){ + public static function deleteLog($day = 90){ $model = new self; - $model->where('add_time','<',time()-7776000); + $times = $day*86400; + $model->where('add_time','<',time()-$times); $model->delete(); } } \ No newline at end of file