Query::filter() adjustments

This commit is contained in:
Alexander Makarov
2014-03-29 23:26:02 +04:00
parent a884c80fe3
commit 8cd247730a
7 changed files with 55 additions and 13 deletions

View File

@@ -819,6 +819,16 @@ class Query extends Component implements QueryInterface
$operator = strtoupper($condition[0]);
switch ($operator) {
case 'NOT':
case 'AND':
case 'OR':
$subCondition = $this->filterCondition($condition[1]);
if ($this->parameterNotEmpty($subCondition)) {
$condition[1] = $subCondition;
} else {
$condition = [];
}
break;
case 'IN':
case 'NOT IN':
case 'LIKE':
@@ -837,7 +847,7 @@ class Query extends Component implements QueryInterface
break;
}
} else {
$condition = $this->filterConditionHash($condition);
$condition = $this->filterHashCondition($condition);
}
return $condition;
}