diff --git a/Access_Core.php b/Access_Core.php
index de7123b..ad5bd65 100644
--- a/Access_Core.php
+++ b/Access_Core.php
@@ -66,6 +66,7 @@ class Access_Core
{
$type = $this->request->get('type', 1);
$filter = $this->request->get('filter', 'all');
+ $fuzzy = $this->request->get('fuzzy', '');
$pagenum = $this->request->get('page', 1);
$offset = (max(intval($pagenum), 1) - 1) * $this->config->pageSize;
$query = $this->db->select()->from('table.access_logs')
@@ -87,18 +88,33 @@ class Access_Core
switch ($filter) {
case 'ip':
$ip = $this->request->get('ip', '');
- $query->where('ip = ?', $ip);
- $qcount->where('ip = ?', $ip);
+ if ($fuzzy == '1') {
+ $query->where('ip LIKE ?', $ip);
+ $qcount->where('ip LIKE ?', $ip);
+ } else {
+ $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);
+ if ($fuzzy == '1') {
+ $query->where('content_id LIKE ?', $cid);
+ $qcount->where('content_id LIKE ?', $cid);
+ } else {
+ $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);
+ if ($fuzzy == '1') {
+ $query->where('path LIKE ?', $path);
+ $qcount->where('path LIKE ?', $path);
+ } else {
+ $query->where('path = ?', $path);
+ $qcount->where('path = ?', $path);
+ }
break;
}
$list = $this->db->fetchAll($query);
diff --git a/page/console.php b/page/console.php
index f26a751..a7ccc2f 100644
--- a/page/console.php
+++ b/page/console.php
@@ -49,6 +49,10 @@ $access = new Access_Core();
+