src/Leevel/Tree/Tree.php
public function hasChildren($id, array $validateChildren, bool $strict = true): bool
    {
        if (empty($validateChildren)) {
            return false;
        }

        $children = $this->getChildren($id);

        if (true === $strict && array_diff($validateChildren, $children)) {
            return false;
        }

        if (false === $strict && array_intersect($validateChildren, $children)) {
            return true;
        }

        return false;
    }
public function hasChildren($id, array $validateChildren, bool $strict = true): bool
    {
        if (empty($validateChildren)) {
            return false;
        }

        $children = $this->getChildren($id);

        if (true === $strict && array_diff($validateChildren, $children)) {
            return false;
        }

        if (false === $strict && array_intersect($validateChildren, $children)) {
            return true;
        }

        return false;
    }
验证是否存在子菜单.

@param int|string $id
@param array      $validateChildren
@param bool       $strict

@return bool