From 4e9179be81ea0a6d1d41843d5ced198efb09b229 Mon Sep 17 00:00:00 2001 From: zhaoxiang Date: Fri, 9 Feb 2018 16:59:33 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E5=AE=8C=E5=96=84=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BB=84=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Auth.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/Auth.php b/application/admin/controller/Auth.php index 71ffb38..b1f87e1 100644 --- a/application/admin/controller/Auth.php +++ b/application/admin/controller/Auth.php @@ -11,7 +11,6 @@ namespace app\admin\controller; use app\model\ApiAuthGroup; use app\model\ApiAuthRule; use app\model\ApiMenu; -use app\model\ApiUser; use app\util\ReturnCode; class Auth extends Base { @@ -28,8 +27,13 @@ class Auth extends Base { $limit = $this->request->get('size', config('apiAdmin.ADMIN_LIST_DEFAULT')); $start = $limit * ($this->request->get('page', 1) - 1); + $keywords = $this->request->get('keywords', ''); + $status = $this->request->get('status', ''); - $where = []; + $where['name'] = ['like', "%{$keywords}%"]; + if ($status === '1' || $status === '0') { + $where['status'] = $status; + } $listModel = (new ApiAuthGroup())->where($where)->order('id', 'DESC'); $listInfo = $listModel->limit($start, $limit)->select();