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 Feb 17, 2016
1 parent c7c05b2 commit 37670f8
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 @@ -478,7 +478,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 37670f8

Please sign in to comment.