feat: 调整导航二级栏目

master
yin5th 2023-08-01 15:35:54 +08:00
parent e0819ffe6c
commit d33cfe70bd
3 changed files with 40 additions and 4 deletions

View File

@ -17,6 +17,13 @@ class News extends Base
$categoryId = input("category_id", 0);
if (!empty($categoryId)) {
$category = Category::where('id', $categoryId)->find();
$childrenCategory = Category::where('parent_id', $categoryId)->order('sort', 'asc')->select();
// 若访问的是二级列表 如总的层级 新闻动态-省市县行业政策-集团要问 访问的是省市县行业政策这一层级则直接获取下面的分类第一个
if (!$childrenCategory->isEmpty()) {
$category = $childrenCategory[0];
}
$parentCategory = Category::where('id', $category['parent_id'])->find();
} else {
$parentCategory = Category::where('parent_id', Category::CATEGORY_NEWS)->order('sort asc')->find();

View File

@ -1 +0,0 @@
open_basedir=/data/wwwroot/pzct/:/tmp/

View File

@ -11,25 +11,55 @@
<li class="nLi {if $Request.controller == 'About'}curr{/if}">
<h3><a href="/about.html">走进产投</a></h3>
<!-- 二级菜单 -->
<div class="listcur">
<a href="/about.html#into1">集团简介</a>
<a href="/about.html#into2">集团领导</a>
<a href="/about.html#into3">发展战略</a>
<a href="/about.html#into4">集团荣誉</a>
<a href="/about.html#into5">组织架构</a>
<a href="/about.html#into6">业务板块</a>
</div>
</li>
<li class="nLi {if in_array($Request.controller,['News'])}curr{/if}">
<h3><a href="/news.html">新闻动态</a></h3>
<!-- 二级菜单 -->
<div class="listcur">
<a href="/news.html?category_id=8">政策性文件</a>
<a href="/news.html?category_id=9">省市县行业政策</a>
</div>
</li>
<li class="nLi {if in_array($Request.controller,['Djqt'])}curr{/if}">
<h3><a href="/djqt.html">党建群团</a></h3>
<!-- 二级菜单 -->
<div class="listcur">
<a href="/djqt.html?category_id=10">党建工作</a>
<a href="/djqt.html?category_id=11">工会群团</a>
</div>
</li>
<li class="nLi {if in_array($Request.controller,['Ljct'])}curr{/if}">
<h3><a href="/ljct.html">廉洁产投</a></h3>
<!-- 二级菜单 -->
<div class="listcur">
<a href="/ljct.html?category_id=12">工作动态</a>
<a href="/ljct.html?category_id=13">廉洁教育</a>
<a href="/ljct.html?category_id=14">警钟长鸣</a>
<a href="/ljct.html?category_id=15">在线举报</a>
</div>
</li>
<li class="nLi {if in_array($Request.controller,['Info'])}curr{/if}">
<h3><a href="/info.html">信息公开</a></h3>
<!-- 二级菜单 -->
<div class="listcur">
<a href="/info.html?category_id=16">人才招揽</a>
<a href="/info.html?category_id=17">合作交流</a>
<a href="/info.html?category_id=18">招采平台</a>
<a href="/info.html?category_id=19">信息公布</a>
</div>
</li>
<li class="nLi {if in_array($Request.controller,['Contact'])}curr{/if}">