src/Service/DB/Select.php
public function orderBy($expressions)
    {
        $expressions = is_array($expressions) ? $expressions : func_get_args();

        $order_by = [];
        foreach ($expressions as $key => $expression) {
            if ($expression instanceof Expr) {
                $order_by[] = $expression;
            } else {
                if (is_numeric($key)) {
                    $column = $expression;
                    $sort = 'ASC';
                } else {
                    $column = $key;
                    $sort = $expression;
                }

                $column = $this->adapter->quoteIdentifier($column);
                $sort = (strtoupper($sort) === 'DESC') ? 'DESC' : '';

                $order_by[] = $sort ? $column . ' ' . $sort : $column;
            }
        }

        $this->order_by = $order_by;

        return $this;
    }
public function orderBy($expressions)
    {
        $expressions = is_array($expressions) ? $expressions : func_get_args();

        $order_by = [];
        foreach ($expressions as $key => $expression) {
            if ($expression instanceof Expr) {
                $order_by[] = $expression;
            } else {
                if (is_numeric($key)) {
                    $column = $expression;
                    $sort = 'ASC';
                } else {
                    $column = $key;
                    $sort = $expression;
                }

                $column = $this->adapter->quoteIdentifier($column);
                $sort = (strtoupper($sort) === 'DESC') ? 'DESC' : '';

                $order_by[] = $sort ? $column . ' ' . $sort : $column;
            }
        }

        $this->order_by = $order_by;

        return $this;
    }
order by 语句.

@param string|Expr

@return $this

@example

$select->orderBy('foo');
$select->orderBy(new Expr('foo desc'));
$select->orderBy(['foo' => 'desc', 'bar' => 'asc']);
$select->orderBy('foo', 'bar', new Expr('baz desc'));