src/Models/Tree.php
public function getTree(array $columns = ['*'], bool $idAsKey = true)
	{
		$nodes = $this->getLeaves($columns)->prepend($this)->keyBy($this->getKeyName())->toArray();

		return static::datasetToTree($nodes, $idAsKey);
	}
public function getTree(array $columns = ['*'], bool $idAsKey = true)
	{
		$nodes = $this->getLeaves($columns)->prepend($this)->keyBy($this->getKeyName())->toArray();

		return static::datasetToTree($nodes, $idAsKey);
	}
获得一颗树，返回一个Tree的数组

@param array $columns 需要取出的字段名
@param bool 返回的children中，是否以ID为Key
@return array 返回数据