mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-20 08:27:21 +08:00
Fixed bug which prevented a field query as described in the example:
``` $result = Article::find()->query(["field" => ["title" => "yii"]])->all(); ````
This commit is contained in:
@@ -55,8 +55,10 @@ class QueryBuilder extends \yii\base\Object
|
||||
$parts['from'] = (int) $query->offset;
|
||||
}
|
||||
|
||||
if (empty($parts['query'])) {
|
||||
if (empty($query->query)) {
|
||||
$parts['query'] = ["match_all" => (object)[]];
|
||||
} else {
|
||||
$parts['query'] = $query->query;
|
||||
}
|
||||
|
||||
$whereFilter = $this->buildCondition($query->where);
|
||||
|
||||
Reference in New Issue
Block a user