src/Leevel/Validate/UniqueRule.php
protected function normalizeSelect($value, array $parameter, string $field): Select
    {
        $entity = $this->parseEntity($parameter);

        if (isset($parameter[1]) && self::PLACEHOLDER !== $parameter[1]) {
            $field = $parameter[1];
        }

        if (false !== strpos($field, self::SEPARATE)) {
            $select = $entity->selfDatabaseSelect();

            foreach (explode(self::SEPARATE, $field) as $v) {
                $select->where($v, $value);
            }
        } else {
            $select = $entity->where($field, $value);
        }

        return $select;
    }
protected function normalizeSelect($value, array $parameter, string $field): Select
    {
        $entity = $this->parseEntity($parameter);

        if (isset($parameter[1]) && self::PLACEHOLDER !== $parameter[1]) {
            $field = $parameter[1];
        }

        if (false !== strpos($field, self::SEPARATE)) {
            $select = $entity->selfDatabaseSelect();

            foreach (explode(self::SEPARATE, $field) as $v) {
                $select->where($v, $value);
            }
        } else {
            $select = $entity->where($field, $value);
        }

        return $select;
    }
取得查询.

@param array  $parameter
@param mixed  $value
@param string $field

@return \Leevel\Database\Ddd\Select