From 88c8da9f73dfad425998af39e87476f4e21668c8 Mon Sep 17 00:00:00 2001 From: cxdbz Date: Thu, 28 Mar 2019 21:30:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A1=AB=E5=85=85=E5=8D=95=E4=BD=8D=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/system/controller/School.php | 9 +++++--- application/system/model/School.php | 9 +------- application/system/view/school/index.html | 28 +++++++++++++++++++++-- 3 files changed, 33 insertions(+), 13 deletions(-) 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 @@ }); +