public function generateCacheTree(string $table, array $ids = [], string $key = 'id', array $config = [], $return = []): array
    {
        foreach ($ids as $id) {
            if (null === ($children = $this->modelUtil->findModelInstancesBy($table, ['pid = ?'], $id, $config['options']))) {
                $return[$id] = [];

                continue;
            }

            while ($children->next()) {
                $return[$children->pid][$children->{$key}] = $children->{$key};
                $return = $this->generateCacheTree($table, [$children->{$key}], $key, $config, $return);
            }
        }

        return $return;
    }