From d313617e2b7d52cbb242f367bc8303c701f1487b Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 10:23:02 +0800
Subject: [PATCH 1/8] =?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/view/pc/topic_nas/help_detail.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/index/view/pc/topic_nas/help_detail.html b/app/index/view/pc/topic_nas/help_detail.html
index f706b71c..bd3eada5 100644
--- a/app/index/view/pc/topic_nas/help_detail.html
+++ b/app/index/view/pc/topic_nas/help_detail.html
@@ -51,7 +51,7 @@
{volist name="ad.article" id="ae"}
- - {$ae.title}
{/volist}
From e1961d2a833be2d464c3a14049de681b5376e176 Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 10:29:25 +0800
Subject: [PATCH 2/8] =?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/view/mobile/topic_nas/help_detail.html | 4 ++--
app/index/view/pc/topic_nas/help_detail.html | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/index/view/mobile/topic_nas/help_detail.html b/app/index/view/mobile/topic_nas/help_detail.html
index ea383098..bffd6079 100644
--- a/app/index/view/mobile/topic_nas/help_detail.html
+++ b/app/index/view/mobile/topic_nas/help_detail.html
@@ -73,14 +73,14 @@

+ class="arrow {if condition='$ad.id == $Request.get.pid'}rotate{/if}">
{$ad.name}
{volist name="ad.article" id="ae"}
-
- {$ae.title}
{/volist}
diff --git a/app/index/view/pc/topic_nas/help_detail.html b/app/index/view/pc/topic_nas/help_detail.html
index bd3eada5..dcdfa3b8 100644
--- a/app/index/view/pc/topic_nas/help_detail.html
+++ b/app/index/view/pc/topic_nas/help_detail.html
@@ -46,12 +46,12 @@
{volist name="ac.child" id="ad"}
-
-
+
{$ad.name}
{volist name="ad.article" id="ae"}
- - {$ae.title}
{/volist}
From 7e7cfeacbc25c2b030b71162cc0b88975bf14f00 Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 10:36:26 +0800
Subject: [PATCH 3/8] =?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/view/mobile/topic_nas/help_detail.html | 2 +-
app/index/view/pc/topic_nas/help_detail.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/index/view/mobile/topic_nas/help_detail.html b/app/index/view/mobile/topic_nas/help_detail.html
index bffd6079..5273a800 100644
--- a/app/index/view/mobile/topic_nas/help_detail.html
+++ b/app/index/view/mobile/topic_nas/help_detail.html
@@ -77,7 +77,7 @@
{$ad.name}
-
+
{volist name="ad.article" id="ae"}
-
{$ad.name}
-
+
{volist name="ad.article" id="ae"}
- {$ae.title}
From ce6a882c17fbcdf9695ca551d84af9e99f0d8982 Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 10:41:41 +0800
Subject: [PATCH 4/8] =?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/view/pc/topic_nas/help_detail.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/index/view/pc/topic_nas/help_detail.html b/app/index/view/pc/topic_nas/help_detail.html
index c80f98d0..9a60640a 100644
--- a/app/index/view/pc/topic_nas/help_detail.html
+++ b/app/index/view/pc/topic_nas/help_detail.html
@@ -46,7 +46,7 @@
{volist name="ac.child" id="ad"}
-
-
+
{$ad.name}
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 5/8] =?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 = ''
}
From 8ba9006173543cc2be945c14d1732f676ac4be93 Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 11:17:49 +0800
Subject: [PATCH 6/8] =?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 1088e179..a4bedd0b 100644
--- a/app/index/controller/TopicNas.php
+++ b/app/index/controller/TopicNas.php
@@ -347,7 +347,10 @@ class TopicNas extends Common
$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']]:'';
+ if ( isset($parent_two[$v['category_id']]) ) {
+ $v['pid'] = $v['category_id'];
+ $v['category_id'] = $parent_two[$v['category_id']];
+ }
}
return success('success', $articles_data);
From 12e51c6f46a951e5708010adbb5ab9464eb4a5c1 Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 11:22:25 +0800
Subject: [PATCH 7/8] =?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 | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/index/controller/TopicNas.php b/app/index/controller/TopicNas.php
index a4bedd0b..44b09cc3 100644
--- a/app/index/controller/TopicNas.php
+++ b/app/index/controller/TopicNas.php
@@ -347,6 +347,7 @@ class TopicNas extends Common
$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'] = 0;
if ( isset($parent_two[$v['category_id']]) ) {
$v['pid'] = $v['category_id'];
$v['category_id'] = $parent_two[$v['category_id']];
From 721e91dc3112e117a05a14514dce387abdf380fc Mon Sep 17 00:00:00 2001
From: ouzhiqiang <835402500@qq.com>
Date: Fri, 19 Sep 2025 11:37:41 +0800
Subject: [PATCH 8/8] =?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 | 4 ++--
app/index/model/ArticleCategoryModel.php | 10 ++++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/app/index/controller/TopicNas.php b/app/index/controller/TopicNas.php
index 44b09cc3..c4315039 100644
--- a/app/index/controller/TopicNas.php
+++ b/app/index/controller/TopicNas.php
@@ -344,11 +344,11 @@ class TopicNas extends Common
->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
+ $parent_two = ArticleCategoryModel::parentColumn(array_column($categorys, 'id'))->language($this->lang_id)->column('pid','id');//二级分类id
$articles_data = $articles->toArray();
foreach ($articles_data as &$v) {
$v['pid'] = 0;
- if ( isset($parent_two[$v['category_id']]) ) {
+ if ( $parent_two[$v['category_id']] !== $parent ) {
$v['pid'] = $v['category_id'];
$v['category_id'] = $parent_two[$v['category_id']];
}
diff --git a/app/index/model/ArticleCategoryModel.php b/app/index/model/ArticleCategoryModel.php
index b6e43ed0..64f48fd1 100644
--- a/app/index/model/ArticleCategoryModel.php
+++ b/app/index/model/ArticleCategoryModel.php
@@ -56,6 +56,16 @@ class ArticleCategoryModel extends ArticleCategoryBaseModel
$query->where('pid', '=', $parent);
}
+ // 所属上级分类查询
+ public function scopeParentColumn($query, $parent)
+ {
+ if (is_array($parent)) {
+ $query->where('id', 'IN', $parent);
+ return;
+ }
+ $query->where('id', '=', $parent);
+ }
+
// 所属子分类范围查询
public function scopeChild($query, $id, $merge_self = false)