src/Models/Tree.php
public function getLeaves($columns = ['*'])
	{
		$columns = $this->formatColumns($columns);
		$node = $this;
		if (!empty($this->pathKey)) //使用Path搜索出来的节点，无法通过order进行良好的排序
		{
			$builder = static::where($this->pathKey, 'LIKE', $node->getPathKey().'%')->where($node->getKeyName(), '!=', $node->getKey());
			!empty($this->orderKey) && $builder->orderBy($this->orderKey);
			!empty($this->pathKey) && $builder->orderBy($this->pathKey);

			return $builder->get($columns);
		}
		else
		{
			$result = $this->newCollection();
			$children = $this->getChildren($columns);
			foreach($children as $v)
			{
				$result[] = $v;
				$result = $result->merge($v->getLeaves($columns));
			}
			return $result;
		}
	}
public function getLeaves($columns = ['*'])
	{
		$columns = $this->formatColumns($columns);
		$node = $this;
		if (!empty($this->pathKey)) //使用Path搜索出来的节点，无法通过order进行良好的排序
		{
			$builder = static::where($this->pathKey, 'LIKE', $node->getPathKey().'%')->where($node->getKeyName(), '!=', $node->getKey());
			!empty($this->orderKey) && $builder->orderBy($this->orderKey);
			!empty($this->pathKey) && $builder->orderBy($this->pathKey);

			return $builder->get($columns);
		}
		else
		{
			$result = $this->newCollection();
			$children = $this->getChildren($columns);
			foreach($children as $v)
			{
				$result[] = $v;
				$result = $result->merge($v->getLeaves($columns));
			}
			return $result;
		}
	}
获得所有子(孙)集，不包含自己，返回一个Collection

@return array 返回数据