From 839a2435152be9d136fbf690c1c5833caa811a5b Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 6 Sep 2021 15:00:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=9C=B0=E6=8E=A5=E5=8F=AA?= =?UTF-8?q?=E5=87=BA=E7=8E=B0role=5Fid=3D2=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Renderable/SelectGuide.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/AdminAgent/Renderable/SelectGuide.php b/app/AdminAgent/Renderable/SelectGuide.php index 6ebd572..c4f8913 100644 --- a/app/AdminAgent/Renderable/SelectGuide.php +++ b/app/AdminAgent/Renderable/SelectGuide.php @@ -1,7 +1,6 @@ disableBatchDelete(); $grid->disableBatchActions(); - $grid->model()->where(['status' => UserStatus::NORMAL]); + $grid->model()->where(['status' => UserStatus::NORMAL]) + ->whereExists(function ($query) { + $role_table = 'admin_guide_role_users'; + return $query->from($role_table)->whereRaw("guides.id=$role_table.user_id")->where('role_id', 2); + }); $grid->quickSearch(['contact_phone', 'name'])->placeholder('搜索手机号、地接名称'); $grid->column('id');