core/SqlSelector.php
public function group(string $group, $args = null)
    {
        $group = trim($group);
        if ($this->groupItem === null) {
            if (!preg_match('@^by\s+@i', $group)) {
                $group = 'by ' . $group;
            }
            $this->groupItem = new SqlItem($group, $args);
        } else {
            if (!preg_match('@^(by|,)\s+@i', $group)) {
                $group = ',' . $group;
            }
            $this->groupItem->add($group, $args);
        }
        return $this;
    }
public function group(string $group, $args = null)
    {
        $group = trim($group);
        if ($this->groupItem === null) {
            if (!preg_match('@^by\s+@i', $group)) {
                $group = 'by ' . $group;
            }
            $this->groupItem = new SqlItem($group, $args);
        } else {
            if (!preg_match('@^(by|,)\s+@i', $group)) {
                $group = ',' . $group;
            }
            $this->groupItem->add($group, $args);
        }
        return $this;
    }
设置组
@param string $group
@param null $args
@return $this