From 8a617c06e9601acdbea7aca7a1884a9b3881946b Mon Sep 17 00:00:00 2001 From: ouzhiqiang <835402500@qq.com> Date: Thu, 18 Sep 2025 16:00:49 +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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/index/controller/TopicNas.php b/app/index/controller/TopicNas.php index 960f9301..4381463c 100644 --- a/app/index/controller/TopicNas.php +++ b/app/index/controller/TopicNas.php @@ -263,18 +263,21 @@ class TopicNas extends Common ->isShow(true) ->order(['sort' => 'asc', 'id' => 'desc']) ->select(); - dump($article_categorys->toArray());exit; +// dump($article_categorys->toArray());exit; //查询三级分类 $article_categorys_new = []; + $article_categorys_two = []; if (!$article_categorys->isEmpty()) { foreach ($article_categorys as $kk=>$vv) { - $article_categorys_two = []; if ( $parent == $vv->pid ) { - + array_push($article_categorys_new,$vv); + } else { + $article_categorys_two[$vv->pid][] = $vv; } - } } + dump($article_categorys_new); + dump($article_categorys_two);exit; View::assign('article_categorys', $article_categorys);