Skip to content

Commit ee0c57f

Browse files
authored
Update TreeHelper.php
1 parent feae789 commit ee0c57f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/helper/TreeHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ public static function getTree($list,$title = 'title',$pid=0, $parentField = 'pi
2727
$parentId = $data[$parentField];
2828
if ($pid == $parentId) {
2929
$tree[$data[$pk]] =& $list[$key];
30+
$tree[$data[$pk]]['isParent'] = true;
31+
$tree[$data[$pk]]['parentId'] = 0;
3032
}else{
3133
if (isset($refer[$parentId])) {
3234
$parent =& $refer[$parentId];
35+
$list[$key]['isParent'] = false;
36+
$list[$key]['parentId'] = $parentId;
3337
$parent[$child][] =& $list[$key];
3438
}
3539
}

0 commit comments

Comments
 (0)