mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 20:59:12 +08:00
ExistValidator bugfix
This commit is contained in:
@@ -111,7 +111,7 @@ class ExistValidator extends Validator
|
||||
$query = $this->createQuery($targetClass, $params);
|
||||
|
||||
if (is_array($object->$attribute)) {
|
||||
if ($query->count("DISTINCT [[$targetAttribute]]") === count($object->$attribute)) {
|
||||
if ($query->count("DISTINCT [[$targetAttribute]]") == count($object->$attribute)) {
|
||||
return;
|
||||
}
|
||||
} elseif ($query->exists()) {
|
||||
|
||||
Reference in New Issue
Block a user