refactor: 系统url

This commit is contained in:
2025-05-07 10:57:39 +08:00
parent d7fe3bfd89
commit cf93ef496e
2 changed files with 15 additions and 16 deletions

View File

@@ -101,14 +101,14 @@ class System
case 'article':
$articles = $this->getArticleByCategory($lang_id, $param['id']);
$urls = array_map(function($item) {
$item['url'] = (string)url('yy/zz', ['id' => $item['id']]);
$item['url'] = (string)url('/index/article/detail/' . $item['id']);
return $item;
}, $articles);
break;
case 'product':
$products = $this->getProductByCategory($lang_id, $param['id']);
$urls = array_map(function($item) {
$item['url'] = (string)url('yy/zz', ['id' => $item['id']]);
$item['url'] = (string)url('/index/product/detail/' . $item['id']);
return $item;
}, $products);
break;
@@ -133,7 +133,7 @@ class System
'name' => '文章分类',
'link_to' => 'article_category',
'data' => array_to_tree(array_map(function($item) {
$item['url'] = (string)url('yy/zz', ['id' => $item['id']]);
$item['url'] = (string)url('/index/article/index/' . $item['id']);
return $item;
}, $article_category), 0, 'pid', false, false)
],
@@ -146,7 +146,7 @@ class System
'name' => '产品分类',
'link_to' => 'product_category',
'data' => array_to_tree(array_map(function($item) {
$item['url'] = (string)url('yy/zz', ['id' => $item['id']]);
$item['url'] = (string)url('/index/product/category/' . $item['id']);
return $item;
}, $product_category), 0, 'pid', false, false)
],
@@ -199,7 +199,6 @@ class System
])
->language($lang_id)
->category($category_id)
->enabled()
->select();
return $data->toArray();

View File

@@ -13,7 +13,7 @@ use think\facade\Route;
Route::get('/', 'Index/index');
// 产品相关路由
Route::group('product', function() {
Route::group('product', function () {
// 产品分类页
Route::get('category/:id', 'Product/category');
// 产品详情页
@@ -27,7 +27,7 @@ Route::group('product', function() {
});
// 文章相关路由
Route::group('article', function() {
Route::group('article', function () {
// 文章列表页
Route::get('index/:pid', 'Article/index');
// 文章详情页
@@ -39,7 +39,7 @@ Route::group('article', function() {
});
// 附件下载
Route::group('attachment', function() {
Route::group('attachment', function () {
// 软件驱动/手册
Route::get('index', 'Attachment/index');
// 视频
@@ -47,13 +47,13 @@ Route::group('attachment', function() {
});
// 问答中心
Route::group('faq', function() {
Route::group('faq', function () {
// 问答列表页
Route::get('index', 'Faq/index');
});
// 关于我们
Route::group('aboutus', function() {
Route::group('aboutus', function () {
// 品牌介绍
Route::get('introduction', 'AboutUs/introduction');
// 品牌故事
@@ -67,7 +67,7 @@ Route::group('aboutus', function() {
});
// 联系我们
Route::group('contactus', function() {
Route::group('contactus', function () {
// 联系我们
Route::get('index', 'ContactUs/index');
// 留言联系我们
@@ -85,9 +85,9 @@ Route::group('contactus', function() {
});
// 专题
Route::group('topic', function() {
Route::group('topic', function () {
// 专题-Nas
Route::group('nas', function() {
Route::group('nas', function () {
// 专题-Nas首页
Route::get('index', 'TopicNas/index');
// 专题-Nas产品体验页