diff --git a/application/admin/controller/Log.php b/application/admin/controller/Log.php index 8072e9b6a..ee0fab644 100644 --- a/application/admin/controller/Log.php +++ b/application/admin/controller/Log.php @@ -39,6 +39,12 @@ class Log extends BasicAdmin { public function index() { $this->title = '系统操作日志'; $db = Db::name($this->table)->order('id desc'); + $get = $this->request->get(); + foreach (['action', 'content', 'username'] as $key) { + if (isset($get[$key]) && $get[$key] !== '') { + $db->where($key, 'like', "%{$get[$key]}%"); + } + } parent::_list($db); } diff --git a/application/admin/view/log.index.html b/application/admin/view/log.index.html index 567887e91..3ec62af7b 100644 --- a/application/admin/view/log.index.html +++ b/application/admin/view/log.index.html @@ -11,6 +11,41 @@ {/block} {block name="content"} + + + + +
diff --git a/public/static/admin/listen.js b/public/static/admin/listen.js index f17cdc6df..b85989d98 100644 --- a/public/static/admin/listen.js +++ b/public/static/admin/listen.js @@ -31,11 +31,12 @@ define(['jquery', 'admin.plugs'], function () { /*! 注册 data-serach 表单搜索行为 */ this.$body.on('submit', 'form.form-search', function () { - var split = this.action.indexOf('?') === -1 ? '?' : '&'; + var url = $(this).attr('action'); + var split = url.indexOf('?') === -1 ? '?' : '&'; if ((this.method || 'get').toLowerCase() === 'get') { - window.location.href = '#' + parseUri(this.action + split + $(this).serialize()); + window.location.href = '#' + parseUri(url + split + $(this).serialize()); } else { - $.form.load(this.action, this, 'post'); + $.form.load(url, this, 'post'); } }); @@ -46,8 +47,7 @@ define(['jquery', 'admin.plugs'], function () { /*! 注册 data-open 事件行为 */ this.$body.on('click', '[data-open]', function () { - var url = $(this).attr('data-open'); - $.form.href(url, this); + $.form.href($(this).attr('data-open'), this); }); /*! 注册 data-reload 事件行为 */