From cfa2b88628a85588bcbc4960bc674555788b3023 Mon Sep 17 00:00:00 2001 From: peijunlei Date: Tue, 8 Sep 2026 13:35:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(search):=20=E4=BD=BF=E7=94=A8=E5=8A=A8?= =?UTF-8?q?=E6=80=81UI=20ID=E6=9B=BF=E6=8D=A2=E7=A1=AC=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E6=A0=8F=E7=9B=AEID=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/frontend/SearchController.php | 35 +++++++--------------- config/ui_ids.php | 14 ++++++++- public/themes/website/1/en/demo/about.html | 30 ++++++++++++++----- public/themes/website/1/en/demo/category.html | 2 +- .../website/1/en/demo/components/footer.html | 4 +-- .../website/1/en/demo/components/header.html | 8 ++--- .../themes/website/1/en/demo/components/mask.html | 4 +-- public/themes/website/1/en/demo/contact.html | 8 ++--- public/themes/website/1/en/demo/news-detail.html | 5 ++-- public/themes/website/1/en/demo/single_search.html | 4 +-- public/themes/website/1/zh/demo/about.html | 30 ++++++++++++++----- public/themes/website/1/zh/demo/category.html | 2 +- .../website/1/zh/demo/components/footer.html | 4 +-- .../website/1/zh/demo/components/header.html | 8 ++--- .../themes/website/1/zh/demo/components/mask.html | 4 +-- public/themes/website/1/zh/demo/contact.html | 8 ++--- public/themes/website/1/zh/demo/news-detail.html | 5 ++-- public/themes/website/1/zh/demo/single_search.html | 4 +-- 18 files changed, 101 insertions(+), 78 deletions(-) diff --git a/app/controller/frontend/SearchController.php b/app/controller/frontend/SearchController.php index 97bd38e..0e064e1 100644 --- a/app/controller/frontend/SearchController.php +++ b/app/controller/frontend/SearchController.php @@ -11,29 +11,14 @@ use app\model\SysSetting; class SearchController extends BaseController { - /** 产品根栏目 */ - private const PRODUCT_CATE_ID = 333; - - /** 新闻根栏目 */ - private const NEWS_CATE_ID = 361; - - // 下载中心 - private const DOWNLOAD_CATE_ID = 356; - - /** 常见问题根栏目 */ - private const FAQ_CATE_ID = 357; - - // 视频教程 - private const VIDEO_CATE_ID = 358; - - //产品公告 - private const ANNOUNCEMENT_CATE_ID = 359; - /** * 获取栏目自身及全部子栏目 ID */ private function getCategoryTreeIds(int $rootId): array { + if ($rootId <= 0) { + return []; + } $category = new Category(); $root = $category->where([ 'id' => $rootId, @@ -184,19 +169,19 @@ class SearchController extends BaseController ['category_id', 'in', $searchCateIds ?: [0]], ])['data'], 'sub_content_id'); - // 各 Tab 固定根栏目(含子栏目) - $productContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(self::PRODUCT_CATE_ID)); - $newsContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(self::NEWS_CATE_ID)); - $faqContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(self::FAQ_CATE_ID)); + // 各 Tab 固定根栏目(含子栏目,按当前语言 uiId) + $productContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(uiId('product'))); + $newsContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(uiId('news'))); + $faqContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(uiId('faq'))); $newsVideoCateId = uiId('news_video'); $newsVideoContentIds = $newsVideoCateId > 0 ? $this->getContentIdsByCategoryIds($this->getCategoryTreeIds($newsVideoCateId)) : []; // 其他 = 下载中心 + 视频 + 公告 - $downloadContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(self::DOWNLOAD_CATE_ID)); - $videoContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(self::VIDEO_CATE_ID)); - $announceContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(self::ANNOUNCEMENT_CATE_ID)); + $downloadContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(uiId('download'))); + $videoContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(uiId('video'))); + $announceContentIds = $this->getContentIdsByCategoryIds($this->getCategoryTreeIds(uiId('announce'))); $otherContentIds = array_values(array_unique(array_merge( $downloadContentIds, $videoContentIds, diff --git a/config/ui_ids.php b/config/ui_ids.php index 58af680..727df3a 100644 --- a/config/ui_ids.php +++ b/config/ui_ids.php @@ -16,11 +16,23 @@ return [ 'product' => ['zh' => 333, 'en' => 704], // 产品 'solution' => ['zh' => 345, 'en' => 716], // 解决方案 'support' => ['zh' => 355, 'en' => 724], // 服务支持 + 'download' => ['zh' => 356, 'en' => 725], // 下载中心 + 'faq' => ['zh' => 357, 'en' => 726], // 常见问题 + 'video' => ['zh' => 358, 'en' => 727], // 视频教程 + 'announce' => ['zh' => 359, 'en' => 728], // 产品公告 'news' => ['zh' => 361, 'en' => 730], // 新闻动态 - 'news_video' => ['zh' => 757, 'en' => 758], // 企业视频(英文栏目建好后填 en) + 'news_video' => ['zh' => 757, 'en' => 758], // 企业视频 'exhibition' => ['zh' => 364, 'en' => 733], // 展会与活动 'invest' => ['zh' => 365, 'en' => 734], // 投资者关系 'about' => ['zh' => 371, 'en' => 740], // 关于睿能 + 'about_intro' => ['zh' => 372, 'en' => 741], // 公司简介 + 'about_history' => ['zh' => 373, 'en' => 742], // 发展历史 + 'about_culture' => ['zh' => 374, 'en' => 743], // 企业文化 + 'about_global' => ['zh' => 375, 'en' => 744], // 全球布局 + 'about_members' => ['zh' => 376, 'en' => 745], // 集团成员 + 'about_honors' => ['zh' => 377, 'en' => 746], // 荣誉资质 + 'about_csr' => ['zh' => 378, 'en' => 747], // 企业社会责任 + 'download_csr' => ['zh' => 691, 'en' => 0], // 社会责任报告(下载子栏目,en 未建则链到下载中心) 'search_hot' => ['zh' => 679, 'en' => 748], // 搜索-热门搜索词 'social_channel' => ['zh' => 707, 'en' => 749], // 社交频道 ]; diff --git a/public/themes/website/1/en/demo/about.html b/public/themes/website/1/en/demo/about.html index 7f8c758..4112a6f 100644 --- a/public/themes/website/1/en/demo/about.html +++ b/public/themes/website/1/en/demo/about.html @@ -65,7 +65,21 @@ - {hcTaglib:category id="372" item="vo" field="*"} + {php} + $ui_about_intro = uiId('about_intro'); + $ui_about_history = uiId('about_history'); + $ui_about_culture = uiId('about_culture'); + $ui_about_global = uiId('about_global'); + $ui_about_members = uiId('about_members'); + $ui_about_honors = uiId('about_honors'); + $ui_about_csr = uiId('about_csr'); + $ui_download_csr = uiId('download_csr'); + $csr_report_href = getMuiLangUrl('/download.html'); + if ($ui_download_csr > 0) { + $csr_report_href .= '?cid=' . $ui_download_csr; + } + {/php} + {hcTaglib:category id="$ui_about_intro" item="vo" field="*"}

{$vo.title}

@@ -95,7 +109,7 @@ {/hcTaglib:category} - {hcTaglib:category id="373" item="vo" field="*"} + {hcTaglib:category id="$ui_about_history" item="vo" field="*"}

{$vo.title}

@@ -147,7 +161,7 @@
{/hcTaglib:category} - {hcTaglib:category id="374" item="vo" field="*"} + {hcTaglib:category id="$ui_about_culture" item="vo" field="*"}
{/hcTaglib:category} - {hcTaglib:category id="375" item="vo" field="*"} + {hcTaglib:category id="$ui_about_global" item="vo" field="*"}

{$vo.title}

{php} @@ -219,7 +233,7 @@
{/hcTaglib:category} - {hcTaglib:category id="376" item="vo" field="*"} + {hcTaglib:category id="$ui_about_members" item="vo" field="*"}
{/hcTaglib:category} - {hcTaglib:category id="377" item="vo" field="*"} + {hcTaglib:category id="$ui_about_honors" item="vo" field="*"}

{$vo.title}

@@ -297,7 +311,7 @@
{/hcTaglib:category} - {hcTaglib:category id="378" item="vo" field="*"} + {hcTaglib:category id="$ui_about_csr" item="vo" field="*"}
diff --git a/public/themes/website/1/en/demo/category.html b/public/themes/website/1/en/demo/category.html index 7ee25c4..a2ca841 100644 --- a/public/themes/website/1/en/demo/category.html +++ b/public/themes/website/1/en/demo/category.html @@ -66,7 +66,7 @@ $current_cate_id = $current_cate['id'] ?? '';
diff --git a/public/themes/website/1/en/demo/components/header.html b/public/themes/website/1/en/demo/components/header.html index 323d81a..8e5992f 100644 --- a/public/themes/website/1/en/demo/components/header.html +++ b/public/themes/website/1/en/demo/components/header.html @@ -165,7 +165,7 @@
-
- +
-
RAYNEN Technology
@@ -20,7 +20,7 @@ /> - +
- +
Download Center

Get product documentation

- +
FAQ

Find the answers you need

- +
Video Tutorials

Watch training videos

- +
Product Notices diff --git a/public/themes/website/1/en/demo/news-detail.html b/public/themes/website/1/en/demo/news-detail.html index cf5d8e7..a6493ab 100644 --- a/public/themes/website/1/en/demo/news-detail.html +++ b/public/themes/website/1/en/demo/news-detail.html @@ -82,7 +82,7 @@
- +
-
RAYNEN 睿能科技
@@ -20,7 +20,7 @@ /> - +
- +
下载中心

获取产品相关资料

- +
常见问题

在这里,寻找想要的答案

- +
视频教程

提供相关视频进行培训

- +
产品公告 diff --git a/public/themes/website/1/zh/demo/news-detail.html b/public/themes/website/1/zh/demo/news-detail.html index 3085839..7dea481 100644 --- a/public/themes/website/1/zh/demo/news-detail.html +++ b/public/themes/website/1/zh/demo/news-detail.html @@ -82,7 +82,7 @@