From 30218f0efeb868fd34b80860c9b2bc605e515b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=90=8D=E5=AE=85=E3=80=82?= Date: Sun, 16 Jul 2017 02:48:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=B8=AA=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=9C=B0=E5=9D=80=E8=AE=BF=E9=97=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Access_Core.php | 9 +++++++-- page/console.php | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Access_Core.php b/Access_Core.php index 03ef3e6..4f473db 100644 --- a/Access_Core.php +++ b/Access_Core.php @@ -66,8 +66,6 @@ class Access_Core { $type = $this->request->get('type', 1); $filter = $this->request->get('filter', 'all'); - $ip = $this->request->get('ip', ''); - $cid = $this->request->get('cid', ''); $pagenum = $this->request->get('page', 1); $offset = (max(intval($pagenum), 1) - 1) * $this->config->pageSize; $query = $this->db->select()->from('table.access_log') @@ -88,14 +86,21 @@ class Access_Core } switch ($filter) { case 'ip': + $ip = $this->request->get('ip', ''); $ip = bindec(decbin(ip2long($ip))); $query->where('ip = ?', $ip); $qcount->where('ip = ?', $ip); break; case 'post': + $cid = $this->request->get('cid', ''); $query->where('content_id = ?', $cid); $qcount->where('content_id = ?', $cid); break; + case 'path': + $path = $this->request->get('path', ''); + $query->where('path = ?', $path); + $qcount->where('path = ?', $path); + break; } $list = $this->db->fetchAll($query); foreach ($list as &$row) { diff --git a/page/console.php b/page/console.php index 566d0da..0bb1662 100644 --- a/page/console.php +++ b/page/console.php @@ -48,6 +48,7 @@ $access = new Access_Core(); + + - "> + filter != 'ip'): ?> [ ? ] @@ -329,6 +331,7 @@ $(document).ready(function() { var $form = $('form.search-form'); var $ipInput = $form.find('input[name="ip"]'); var $cidSelect = $form.find('select[name="cid"]'); + var $pathInput = $form.find('input[name="path"]'); var $filterSelect = $form.find('select[name="filter"]'); var hideInactive = function () { @@ -346,6 +349,9 @@ $(document).ready(function() { case 'post': $cidSelect.show(); break; + case 'path': + $pathInput.attr('placeholder', '输入路由').show(); + break; } });