Skip to content

Commit 67614eb

Browse files
Modified generation of the union queries
1 parent bee2c30 commit 67614eb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Query/Grammar.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@ protected function compileUnions(Builder $query)
176176
return ltrim($sql);
177177
}
178178

179+
/**
180+
* Compile a single union statement.
181+
*
182+
* @param array $union
183+
* @return string
184+
*/
185+
protected function compileUnion(array $union)
186+
{
187+
$conjunction = $union['all'] ? ' union all ' : ' union ';
188+
189+
return $conjunction.'('.$union['query']->toSql().')';
190+
}
191+
179192
/**
180193
* Compile a select query into SQL.
181194
*

0 commit comments

Comments
 (0)