Commit 2be0fd6e by Qiang Xue

more union fix.

parent d9a85d09
...@@ -28,7 +28,6 @@ class QueryBuilder extends \yii\db\QueryBuilder ...@@ -28,7 +28,6 @@ class QueryBuilder extends \yii\db\QueryBuilder
$this->buildWhere($query->where, $params), $this->buildWhere($query->where, $params),
$this->buildGroupBy($query->groupBy), $this->buildGroupBy($query->groupBy),
$this->buildHaving($query->having, $params), $this->buildHaving($query->having, $params),
$this->buildUnion($query->union, $params),
$this->buildOrderBy($query->orderBy), $this->buildOrderBy($query->orderBy),
]; ];
$this->sql = implode($this->separator, array_filter($clauses)); $this->sql = implode($this->separator, array_filter($clauses));
...@@ -36,6 +35,12 @@ class QueryBuilder extends \yii\db\QueryBuilder ...@@ -36,6 +35,12 @@ class QueryBuilder extends \yii\db\QueryBuilder
if ($query->limit !== null || $query->offset !== null) { if ($query->limit !== null || $query->offset !== null) {
$this->sql = $this->buildLimit($query->limit, $query->offset); $this->sql = $this->buildLimit($query->limit, $query->offset);
} }
$unions = $this->buildUnion($query->union, $params);
if ($unions !== '') {
$this->sql .= $this->separator . $unions;
}
return [$this->sql, $params]; return [$this->sql, $params];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment