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