From 04c0aca80f448a193179aa732b5ad126bcb7e9dd Mon Sep 17 00:00:00 2001 From: cxdbz Date: Tue, 11 Jun 2019 19:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8C=E7=BA=A7=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index c77bda92..2822afa1 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -71,7 +71,10 @@ class Index extends Base ->with([ 'authCid'=>function($query) use($rules){ $query->where('status&ismenu',1) - ->where('id','in',$rules) + ->when(session('userid')>2,function($query) use($rules) + { + $query->where('id','in',$rules); + }) ->field('id,title,name,pid,url'); }, ])