mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 02:52:49 +08:00
层级转换增加前缀;
This commit is contained in:
@@ -175,6 +175,7 @@ function array2level($array, $pid = 0, $level = 1)
|
|||||||
foreach ($array as $v) {
|
foreach ($array as $v) {
|
||||||
if ($v['pid'] == $pid) {
|
if ($v['pid'] == $pid) {
|
||||||
$v['level'] = $level;
|
$v['level'] = $level;
|
||||||
|
$v['prefix'] = str_repeat('|--', $level);
|
||||||
$list[] = $v;
|
$list[] = $v;
|
||||||
array2level($array, $v['id'], $level + 1);
|
array2level($array, $v['id'], $level + 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user