fix: 后台产品分类系统urls

This commit is contained in:
2025-06-11 11:03:00 +08:00
parent c4a87bf22b
commit 4023d1f6d7

View File

@@ -146,7 +146,11 @@ class System
'name' => '产品分类', 'name' => '产品分类',
'link_to' => 'product_category', 'link_to' => 'product_category',
'data' => array_to_tree(array_map(function($item) { 'data' => array_to_tree(array_map(function($item) {
$item['url'] = (string)url('/index/product/category/' . $item['id']); if ($item['pid'] == 0) {
$item['url'] = (string)url('/index/product/category/'. $item['id']);
} else {
$item['url'] = (string)url('/index/product/subcategory/' . $item['id']);
}
return $item; return $item;
}, $product_category), 0, 'pid', false, false) }, $product_category), 0, 'pid', false, false)
], ],