From 08355f6d31640a78fc7e50a222314f55f3148d50 Mon Sep 17 00:00:00 2001 From: devlike Date: Thu, 8 Feb 2018 11:08:42 +0800 Subject: [PATCH] =?UTF-8?q?selectpage=E5=8F=AA=E4=BF=9D=E7=95=99id?= =?UTF-8?q?=E5=92=8Cusername=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/auth/Admin.php | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index 73d3bf55..c7aae6a7 100644 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -107,6 +107,32 @@ class Admin extends Backend return $this->view->fetch(); } + /** + * 管理员列表 + */ + public function selectpage() + { + if ($this->request->isAjax()) + { + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $total = $this->model + ->where($where) + ->order($sort, $order) + ->count(); + + $list = $this->model + ->where($where) + ->field(['id', 'username as name']) + ->order($sort, $order) + ->limit($offset, $limit) + ->select(); + + $result = array("total" => $total, "list" => $list); + + return json($result); + } + return null; + } /** * 添加 */