Skip to content

Commit

Permalink
[update] add multi-columns GROUP BY support. req catfan#333
Browse files Browse the repository at this point in the history
  • Loading branch information
SyuTingSong committed Dec 22, 2015
1 parent 16cca63 commit 5f07730
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion medoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ protected function where_clause($where)

if (isset($where[ 'GROUP' ]))
{
$where_clause .= ' GROUP BY ' . $this->column_quote($where[ 'GROUP' ]);
$GROUP = is_array($where['GROUP']) ? $where['GROUP'] : array($where['GROUP']);
$where_clause .= ' GROUP BY ' .
implode(', ', array_map(array($this, 'column_quote'), $GROUP));

if (isset($where[ 'HAVING' ]))
{
Expand Down

0 comments on commit 5f07730

Please sign in to comment.