From f7e551853915b8dfb6dbedadd48e8bb8469e9ff7 Mon Sep 17 00:00:00 2001 From: ouzhiqiang <835402500@qq.com> Date: Fri, 19 Sep 2025 14:31:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/TopicNas.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/index/controller/TopicNas.php b/app/index/controller/TopicNas.php index c4315039..e565cebd 100644 --- a/app/index/controller/TopicNas.php +++ b/app/index/controller/TopicNas.php @@ -192,6 +192,8 @@ class TopicNas extends Common { // 获取文章分类及文章数据 $parent = ArticleCategoryModel::uniqueLabel('CATEGORY_681182e0a4529')->language($this->lang_id)->value('id'); + $parent_two = ArticleCategoryModel::parent($parent)->language($this->lang_id)->column('id');//二级分类id + array_push($parent_two,$parent); $article_categorys = ArticleCategoryModel::with(['article' => function($query) { $query->field(['id', 'title', 'category_id']) ->order(['sort' => 'asc', 'id' => 'desc']) @@ -203,7 +205,8 @@ class TopicNas extends Common 'icon' ]) ->language($this->lang_id) - ->parent($parent) +// ->parent($parent) + ->parentChild($parent_two) ->isShow(true) ->order(['sort' => 'asc', 'id' => 'desc']) ->select();