From 39c0aff9f04581179158e294d6b0e1e37371c0e7 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 29 May 2020 16:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Site/media.html | 2 +- Application/Admin/Widget/IndexWidget.class.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Application/Admin/View/Site/media.html b/Application/Admin/View/Site/media.html index 6fcd1322c..949b46d19 100644 --- a/Application/Admin/View/Site/media.html +++ b/Application/Admin/View/Site/media.html @@ -10,7 +10,7 @@
说明:针对PC官网的显示进行基本配置
diff --git a/Application/Admin/Widget/IndexWidget.class.php b/Application/Admin/Widget/IndexWidget.class.php index 00a46b68e..59b351450 100644 --- a/Application/Admin/Widget/IndexWidget.class.php +++ b/Application/Admin/Widget/IndexWidget.class.php @@ -4,9 +4,13 @@ use Think\Controller; class IndexWidget extends Controller{ - public function navigation($value='',$compare='') + public function navigation($value='',$compare='',$title='') { - $mainID = M('Menu')->where("pid !=0 AND url like '%".$value."%'")->getField('id'); + $where = "pid !=0 AND url like '%".$value."%'"; + if ($title != '') { + $where .= ' AND title=\'' . $title . '\''; + } + $mainID = M('Menu')->where($where)->getField('id'); $MainMenu = M('Menu')->field("id,pid,title,url,status,hide")->where(array('pid'=>$mainID,'hide'=>0))->order("sort asc")->select(); $this->assign("data",$MainMenu); $compare = empty($compare)?CONTROLLER_NAME."/".ACTION_NAME:$compare;