From 12f5139a09294f713b41f92e0d9f01fa409382ae Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Thu, 8 Feb 2018 00:08:26 +0800 Subject: [PATCH] =?UTF-8?q?added=20=E6=96=B0=E5=A2=9E=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/User.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index fd89dbf..7837d87 100644 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -26,11 +26,26 @@ class User extends Base { $limit = $this->request->get('size', config('apiAdmin.ADMIN_LIST_DEFAULT')); $start = $limit * ($this->request->get('page', 1) - 1); + $type = $this->request->get('type', ''); + $keywords = $this->request->get('keywords', ''); + $status = $this->request->get('status', ''); - $key = $this->request->get('key', ''); - $order = $this->request->get('order', ''); + $where = []; + if ($status === '1' || $status === '0') { + $where['status'] = $status; + } + if ($type) { + switch ($type) { + case 1: + $where['username'] = ['like', "%{$keywords}%"]; + break; + case 2: + $where['nickname'] = ['like', "%{$keywords}%"]; + break; + } + } - $listModel = (new ApiUser())->where([])->order('regTime', 'DESC'); + $listModel = (new ApiUser())->where($where)->order('regTime', 'DESC'); $listInfo = $listModel->limit($start, $limit)->select(); $count = $listModel->count(); @@ -59,7 +74,7 @@ class User extends Base { } /** - * 新增用户 + * 新增用户 等待组权限 * @return array * @author zhaoxiang */