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 = '