src/Leevel/Database/Ddd/Repository.php
protected function normalizeCondition($condition, Select $select): void
    {
        if (is_string($condition)) {
            $select->scope($condition);
        } elseif (is_object($condition) && $condition instanceof ISpecification) {
            $this->normalizeSpec($select, $condition);
        } elseif (is_object($condition) && $condition instanceof Closure) {
            $condition($select, $this->entity);
        } elseif (is_array($condition) && count($condition) >= 2) {
            $tmpCondition = array_shift($condition);
            $scope = $condition;

            $this->normalizeCondition($tmpCondition, $select);
            $select->scope($scope);
        } else {
            throw new InvalidArgumentException('Invalid condition type.');
        }
    }
protected function normalizeCondition($condition, Select $select): void
    {
        if (is_string($condition)) {
            $select->scope($condition);
        } elseif (is_object($condition) && $condition instanceof ISpecification) {
            $this->normalizeSpec($select, $condition);
        } elseif (is_object($condition) && $condition instanceof Closure) {
            $condition($select, $this->entity);
        } elseif (is_array($condition) && count($condition) >= 2) {
            $tmpCondition = array_shift($condition);
            $scope = $condition;

            $this->normalizeCondition($tmpCondition, $select);
            $select->scope($scope);
        } else {
            throw new InvalidArgumentException('Invalid condition type.');
        }
    }
处理查询条件.

@param array|\Closure|\Leevel\Database\Ddd\ISpecification|string $condition
@param \Leevel\Database\Ddd\Select                               $select