mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
优化分类遍历错误;
This commit is contained in:
@@ -204,12 +204,14 @@ function array2level($array, $pid = 0, $level = 1)
|
||||
$level = 1;
|
||||
}
|
||||
foreach ($array as $v) {
|
||||
if(!empty($v)) {
|
||||
if ($v['pid'] == $pid) {
|
||||
$v['level'] = $level;
|
||||
$list[] = $v;
|
||||
array2level($array, $v['id'], $level + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// halt($list);
|
||||
|
||||
return $list;
|
||||
|
||||
Reference in New Issue
Block a user