Jonlin 6 年之前
父節點
當前提交
8c59277962
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      application/admin/controller/Iplimit.php

+ 5 - 2
application/admin/controller/Iplimit.php

@@ -14,7 +14,7 @@ class Iplimit extends Base
             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();
+                $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();
@@ -23,6 +23,8 @@ class Iplimit extends Base
                     $result[] = $res[$i];
                 }
             }
+//            array_unique($result, SORT_REGULAR);
+            
             $admins = db('admins')->select();
             foreach ($result as $key => $vo) {
 
@@ -41,7 +43,8 @@ class Iplimit extends Base
             }
 
             // 总数据.
-            $return['total'] = db('iplimit')->where($where)->count();  //总数据
+            $return['total'] = count($result);  //总数据
+//            $return['total'] = db('iplimit')->where($where)->count();  //总数据
             $return['rows'] = $result;
 
             return json($return);