修改类库

This commit is contained in:
wuyanwen
2019-12-26 09:03:19 +08:00
parent 1dcce85c3a
commit 201cb455f5
4 changed files with 29 additions and 83 deletions

View File

@@ -10,7 +10,9 @@ class Tree
foreach ($items as $key => $item) {
if ($item[$pidField] == $pid) {
$child = self::done($items, $item['id'], $pidField);
$item[$children] = count($child) ? $child : [];
if (count($child)) {
$item[$children] = $child;
}
$tree[] = $item;
}
}