refactor: 修改数组转树状结构封装

This commit is contained in:
2025-03-15 11:11:45 +08:00
parent 218d5f0bbe
commit a5f35ac4be

View File

@@ -24,7 +24,7 @@ if (!function_exists('array_to_tree')) {
if ($keep_pid === false) { if ($keep_pid === false) {
unset($item[$with]); unset($item[$with]);
} }
$children = array_to_tree($data, $item['id'], $with, $lv); $children = array_to_tree($data, $item['id'], $with, $lv, $keep_pid);
if ($children) { if ($children) {
$item['children'] = $children; $item['children'] = $children;
} }