mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
系统日志导出
This commit is contained in:
parent
55a6831d01
commit
543a5f4093
@ -44,9 +44,13 @@ class Oplog extends Controller
|
||||
{
|
||||
$this->title = '系统日志管理';
|
||||
$this->isSupper = AdminService::instance()->isSuper();
|
||||
$query = $this->_query($this->table);
|
||||
$query->like('action,node,content,username,geoip');
|
||||
$query->dateBetween('create_at')->order('id desc')->page();
|
||||
$query = $this->_query($this->table)->order('id desc');
|
||||
$query->like('action,node,content,username,geoip')->dateBetween('create_at');
|
||||
if (input('output') === 'json') {
|
||||
$this->success('获取数据成功', $query->page(true, false));
|
||||
} else {
|
||||
$query->page();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,10 +47,25 @@
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<button class="layui-btn layui-btn-primary"><i class="layui-icon"></i> 搜 索</button>
|
||||
<button type="submit" class="layui-btn layui-btn-primary"><i class="layui-icon"></i> 搜 索</button>
|
||||
<button type="button" data-form-export="{:url('index')}?type={$type|default=''}" class="layui-btn layui-btn-primary">
|
||||
<i class="layui-icon layui-icon-export"></i> 导 出
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<script>form.render()</script>
|
||||
|
||||
<script>
|
||||
window.form.render();
|
||||
require(['excel'], function (excel) {
|
||||
excel.bind(function (data) {
|
||||
data.forEach(function (item, index) {
|
||||
data[index] = [item.username, item.node, item.geoip, item.action, item.create_at];
|
||||
});
|
||||
data.unshift(['操作账号', '访问节点', '访问IP地址', '访问操作', '访问时间']);
|
||||
return data;
|
||||
}, '访问日志');
|
||||
});
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user