diff --git a/application/system/controller/School.php b/application/system/controller/School.php index 5852af80..82aaadd2 100644 --- a/application/system/controller/School.php +++ b/application/system/controller/School.php @@ -88,18 +88,21 @@ class School extends Base public function ajaxData() { + $list = request()->post(); + // 实例化 $sch = new sch; - // 获取荣誉总数 - $data = $sch->select(); + $cnt = $sch->count(); + // // 获取荣誉总数 + $data = $sch->page($list['page'],$list['limit'])->select(); // 重组返回内容 $data = [ 'code'=> 0 , // ajax请求次数,作为标识符 'msg'=>"", // 获取到的结果数(每页显示数量) - 'count'=>100, // 符合条件的总数据量 + 'count'=>$cnt, // 符合条件的总数据量 'data'=>$data, //获取到的数据结果 ]; diff --git a/application/system/model/School.php b/application/system/model/School.php index a137f228..dc2047bb 100644 --- a/application/system/model/School.php +++ b/application/system/model/School.php @@ -36,15 +36,9 @@ class School extends Base // 查询所有单位 - public function search($search) + public function search() { // 获取参数 - $xingzhi = $search['xingzhi']; - $order_field = $search['order_field']; - $order = $search['order']; - $search = $search['search']; - - $data = $this->order([$order_field =>$order]) ->when(strlen($xingzhi)>0,function($query) use($xingzhi){ @@ -73,7 +67,6 @@ class School extends Base } ] ) - // ->append(['cnt']) ->select(); diff --git a/application/system/view/school/index.html b/application/system/view/school/index.html index b6024cad..5e48785c 100644 --- a/application/system/view/school/index.html +++ b/application/system/view/school/index.html @@ -70,10 +70,31 @@ }); +