mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-01-19 05:48:15 +00:00
日志搜索添加路径和IP搜索
This commit is contained in:
parent
c56a0f47d9
commit
617cca0dda
@ -84,6 +84,8 @@ class SystemLog extends ModelBasic
|
|||||||
$model = new self;
|
$model = new self;
|
||||||
$model = $model->alias('l');
|
$model = $model->alias('l');
|
||||||
if($where['pages'] !== '') $model = $model->where('l.page','LIKE',"%$where[pages]%");
|
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'] != '')
|
if($where['admin_id'] != '')
|
||||||
$adminIds = $where['admin_id'];
|
$adminIds = $where['admin_id'];
|
||||||
else
|
else
|
||||||
@ -99,13 +101,11 @@ class SystemLog extends ModelBasic
|
|||||||
return self::page($model,$where);
|
return self::page($model,$where);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @day
|
|
||||||
* 删除超过90天的日志
|
* 删除超过90天的日志
|
||||||
*/
|
*/
|
||||||
public static function deleteLog($day = 90){
|
public static function deleteLog(){
|
||||||
$model = new self;
|
$model = new self;
|
||||||
$times = $day*86400;
|
$model->where('add_time','<',time()-7776000);
|
||||||
$model->where('add_time','<',time()-$times);
|
|
||||||
$model->delete();
|
$model->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -24,6 +24,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" name="pages" value="{$where.pages}" placeholder="请输入行为" class="input-sm form-control"> <span class="input-group-btn">
|
<input type="text" name="pages" value="{$where.pages}" placeholder="请输入行为" class="input-sm form-control"> <span class="input-group-btn">
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" name="path" value="{$where.path}" placeholder="请输入链接" class="input-sm form-control"> <span class="input-group-btn">
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" name="ip" value="{$where.ip}" placeholder="请输入ip" class="input-sm form-control"> <span class="input-group-btn">
|
||||||
<button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search" ></i> 搜索</button> </span>
|
<button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search" ></i> 搜索</button> </span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -42,6 +48,7 @@
|
|||||||
<th class="text-center">操作时间</th>
|
<th class="text-center">操作时间</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody class="">
|
<tbody class="">
|
||||||
{volist name="list" id="vo"}
|
{volist name="list" id="vo"}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user