src/Service/DB/Select.php
protected function compileGroupBy()
    {
        if (!$this->group_by) {
            return ['', []];
        }

        list($group_columns, $having, $having_params) = $this->group_by;

        $group_columns = $this->adapter->quoteIdentifier($group_columns);
        if (is_array($group_columns)) {
            $group_columns = implode(',', $group_columns);
        }

        $sql = 'GROUP BY ' . $group_columns;
        if ($having) {
            $sql .= ' HAVING ' . $having;
        }

        return [$sql, $having_params];
    }
protected function compileGroupBy()
    {
        if (!$this->group_by) {
            return ['', []];
        }

        list($group_columns, $having, $having_params) = $this->group_by;

        $group_columns = $this->adapter->quoteIdentifier($group_columns);
        if (is_array($group_columns)) {
            $group_columns = implode(',', $group_columns);
        }

        $sql = 'GROUP BY ' . $group_columns;
        if ($having) {
            $sql .= ' HAVING ' . $having;
        }

        return [$sql, $having_params];
    }
编译group by 子句.

@return
array(
(string),    // group by 子句
(array),     // 查询参数
)