src/Tree/Traits/TreeTrait.php
public function getSubLevel($parentId)
    {
        $data = $this->getAllNodes();

        $childList = collect([]);
        foreach ($data as $val) {
            if ($val->{$this->getTreeNodeParentIdName()} == $parentId) {
                $childList->put($val->{$this->getTreeNodeIdName()}, $val);
            }
        }

        return $childList;
    }
public function getSubLevel($parentId)
    {
        $data = $this->getAllNodes();

        $childList = collect([]);
        foreach ($data as $val) {
            if ($val->{$this->getTreeNodeParentIdName()} == $parentId) {
                $childList->put($val->{$this->getTreeNodeIdName()}, $val);
            }
        }

        return $childList;
    }
public function getSubLevel ( $ parentId ) { $ data = $ this -> getAllNodes ( ) ; $ childList = collect ( [ ] ) ; foreach ( $ data as $ val ) { if ( $ val -> { $ this -> getTreeNodeParentIdName ( ) } == $ parentId ) { $ childList -> put ( $ val -> { $ this -> getTreeNodeIdName ( ) } , $ val ) ; } } return $ childList ; }
获取子级（仅子代一级）.

@param mixed $parentId

@return array
获取子级（仅子代一级） .