public function groupBy($groupKeys)
    {
        if (is_string($groupKeys))
        {
            $groupKeys = $this->stringArgumentToArray($groupKeys);
        }

        foreach ($groupKeys as $groupKey) 
        {
            $this->groups[] = $groupKey;
        }

        return $this;
    }
public function groupBy($groupKeys)
    {
        if (is_string($groupKeys))
        {
            $groupKeys = $this->stringArgumentToArray($groupKeys);
        }

        foreach ($groupKeys as $groupKey) 
        {
            $this->groups[] = $groupKey;
        }

        return $this;
    }
public function groupBy ( $ groupKeys ) { if ( is_string ( $ groupKeys ) ) { $ groupKeys = $ this -> stringArgumentToArray ( $ groupKeys ) ; } foreach ( $ groupKeys as $ groupKey ) { $ this -> groups [ ] = $ groupKey ; } return $ this ; }
Add a group by statement to the current query

->groupBy('category')
->gorupBy(['category', 'price'])

@param array|string              $keys
@return self The current query builder.
Add a group by statement to the current query