|
@@ -7,7 +7,7 @@ if (!function_exists('list_to_tree')) {
|
|
|
{
|
|
{
|
|
|
$branch = [];
|
|
$branch = [];
|
|
|
foreach ($elements as $element) {
|
|
foreach ($elements as $element) {
|
|
|
- if ($element['$parentKey'] == $parentId) {
|
|
|
|
|
|
|
+ if ($element[$parentKey] == $parentId) {
|
|
|
$children = list_to_tree($elements, $element['id']);
|
|
$children = list_to_tree($elements, $element['id']);
|
|
|
if ($children) {
|
|
if ($children) {
|
|
|
$element['children'] = $children;
|
|
$element['children'] = $children;
|