Add group by support in sql criteria.
This commit is contained in:
@ -206,11 +206,13 @@ abstract class SqlModel extends Model
|
||||
{
|
||||
$select = $this->db->selectExpr($select, $distinct);
|
||||
$where = $this->db->whereExpr($where);
|
||||
$group_by = $this->db->groupByExpr($group_by);
|
||||
$order = isset($order['sort']) ? $this->order($order, $order['sort']) : false;
|
||||
$limit = $this->db->limitExpr($limit);
|
||||
$result_items = $this->fetchAll(
|
||||
(($sql_expression) ? $sql_expression : ('SELECT ' . $select . ' FROM ' . $this->table()))
|
||||
. (($where) ? (' WHERE ' . $where) : '')
|
||||
. (($group_by) ? (' GROUP BY ' . $group_by) : '')
|
||||
. (($order) ? ($order) : '')
|
||||
. (($limit) ? (' LIMIT ' . $limit) : ''),
|
||||
$sql_expression_params,
|
||||
|
Reference in New Issue
Block a user