From f70e1f3349b4c0b6afab65aa4073ba81aaa75768 Mon Sep 17 00:00:00 2001 From: Karson Date: Sat, 12 Sep 2020 16:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0=E5=9B=9E?= =?UTF-8?q?=E6=94=B6=E7=AB=99=E5=88=97=E8=A1=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/library/traits/Backend.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index 538a1d29..f81f62fe 100755 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -72,20 +72,14 @@ trait Backend $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - $total = $this->model - ->onlyTrashed() - ->where($where) - ->order($sort, $order) - ->count(); $list = $this->model ->onlyTrashed() ->where($where) ->order($sort, $order) - ->limit($offset, $limit) - ->select(); + ->paginate($limit); - $result = array("total" => $total, "rows" => $list); + $result = array("total" => $list->total(), "rows" => $list->items()); return json($result); }