Jonlin 6 years ago
parent
commit
68860c2202
1 changed files with 7 additions and 0 deletions
  1. 7 0
      application/admin/controller/Iplimit.php

+ 7 - 0
application/admin/controller/Iplimit.php

@@ -12,10 +12,17 @@ class Iplimit extends Base
             $offset = (($param['pageNumber'] - 1) * $limit);
             $where['object'] = $param['type'];
             if (strlen($param['searchText'])) {
+                $ip = bindec(decbin(ip2long($param['searchText'])));
                 $where['ip'] = ['like', '%' . $param['searchText'] . '%'];
+                $res = db('iplimit')->where('start_ip','<=',$ip)->where('end_ip','>=',$ip)->where('object',$param['type'])->limit($offset, $limit)->select();
             }
 
             $result = db('iplimit')->where($where)->limit($offset, $limit)->select();
+            if(!empty($res)){
+                for($i=0;$i<count($res);$i++){
+                    $result[] = $res[$i];
+                }
+            }
             $admins = db('admins')->select();
             foreach ($result as $key => $vo) {