层级转换增加前缀;

This commit is contained in:
augushong
2021-06-23 16:08:36 +08:00
parent febb24c34f
commit afc2cbe21b

View File

@@ -175,6 +175,7 @@ function array2level($array, $pid = 0, $level = 1)
foreach ($array as $v) {
if ($v['pid'] == $pid) {
$v['level'] = $level;
$v['prefix'] = str_repeat('|--', $level);
$list[] = $v;
array2level($array, $v['id'], $level + 1);
}