fix:修复子节点组装方法漏传pk的问题 close #I6PQ9X

This commit is contained in:
妙码生花 2023-03-28 04:03:47 +08:00
parent 976f2dbe2c
commit c4127a82b7

View File

@ -136,7 +136,7 @@ class Tree
if (!$data) return [];
foreach ($data as $key => $item) {
if (array_key_exists($item[$pk], $this->childrens)) {
$data[$key]['children'] = $this->getChildren($this->childrens[$item[$pk]]);
$data[$key]['children'] = $this->getChildren($this->childrens[$item[$pk]], $pk);
}
}
return $data;