mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Add support for yii\db\Expression to QueryBuiler simple conditions
fixes #5601
This commit is contained in:
@ -1238,6 +1238,11 @@ class QueryBuilder extends \yii\base\Object
|
||||
|
||||
if ($value === null) {
|
||||
return "$column $operator NULL";
|
||||
} elseif ($value instanceof Expression) {
|
||||
foreach ($value->params as $n => $v) {
|
||||
$params[$n] = $v;
|
||||
}
|
||||
return "$column $operator {$value->expression}";
|
||||
} else {
|
||||
$phName = self::PARAM_PREFIX . count($params);
|
||||
$params[$phName] = $value;
|
||||
|
||||
Reference in New Issue
Block a user