From a7d413871bb71444c26babb9eb65eb11a0fd0f11 Mon Sep 17 00:00:00 2001 From: ouzhiqiang <835402500@qq.com> Date: Fri, 19 Sep 2025 11:09:29 +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 | 8 +++++++- app/index/view/pc/topic_nas/help_detail.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/index/controller/TopicNas.php b/app/index/controller/TopicNas.php index 5884aeed..1088e179 100644 --- a/app/index/controller/TopicNas.php +++ b/app/index/controller/TopicNas.php @@ -343,8 +343,14 @@ class TopicNas extends Common ->language($this->lang_id) ->where('category_id', 'IN', array_column($categorys, 'id')) ->select(); + //查询上级id + $parent_two = ArticleCategoryModel::ParentChild(array_column($categorys, 'id'))->language($this->lang_id)->column('pid','id');//二级分类id + $articles_data = $articles->toArray(); + foreach ($articles_data as &$v) { + $v['pid'] = isset($parent_two[$v['category_id']])?$parent_two[$v['category_id']]:''; + } - return success('success', $articles->toArray()); + return success('success', $articles_data); } /** diff --git a/app/index/view/pc/topic_nas/help_detail.html b/app/index/view/pc/topic_nas/help_detail.html index 9a60640a..12950c6b 100644 --- a/app/index/view/pc/topic_nas/help_detail.html +++ b/app/index/view/pc/topic_nas/help_detail.html @@ -135,7 +135,7 @@ html = '