src/Leevel/Tree/Tree.php
public function getChildren($id = 0): array
    {
        $data = [];

        foreach ($this->getChild($id) as $key) {
            $data[] = $key;
            $data = array_merge($data, $this->getChildren($key));
        }

        return $data;
    }
public function getChildren($id = 0): array
    {
        $data = [];

        foreach ($this->getChild($id) as $key) {
            $data[] = $key;
            $data = array_merge($data, $this->getChildren($key));
        }

        return $data;
    }
取得给定 ID 所有子树 ID.

@param int|string $id

@return array