Устанавливает условие сортировки
@param string $column имя столбца, может быть плейсхолдером
@param string $direction направление сортировки, ASC по умолчанию
@return $this|ISelectBuilder|IDeleteBuilder|IUpdateBuilder
512277
public function orderBy($column, $direction = IQueryBuilder::ORDER_ASC)
    {
        if ($direction == IQueryBuilder::ORDER_ASC || $direction == IQueryBuilder::ORDER_DESC) {
            $this->orderConditions[$column] = $direction;
        }

        return $this;
    }
428041
public function apply($query, $column, $direction = 'asc')
    {
        $direction = $direction === 'desc' ? 'desc' : 'asc';

        if ($query instanceof Model) {
            $query = $query->query();
        }

        $query = $this->applyNullLastQuery($query, $column);

        return $query->orderBy($column, $direction);
    }
185713
protected function getNullsLastSql($column, $direction)
    {
        $sql = $this->config->get('datatables.nulls_last_sql', '%s %s NULLS LAST');

        return sprintf($sql, $column, $direction);
    }
141368
public function like($column, $pattern)
    {
        $this->conditions = [$this->grammar->buildId($column) . ' LIKE ' . $pattern];

        return $this;
    }
512297
protected function tableColumn($column)
    {
        if (is_null($this->table)) {
            $this->setTable();
        }

        return new Column($this->context, $this->table, $column);
    }
1082579
public function columns(string $column, string ...$columns)
    {
        array_unshift($columns, $column);

        foreach ($columns as $column) {
            $this->column($column);
        }

        return $this;
    }
493180
public function sortBy($field, $direction = 'asc', $flags = null)
    {
        $this->sortByField = $field;

        // Normalize direction.
        $direction = strtolower($direction);

        if ($direction === 'asc' || $direction === 'desc') {
            $this->sortByDirection = $direction;
        }

        if (is_null($flags)) {
            $this->sortByFlags = SORT_NATURAL + SORT_FLAG_CASE;
        }

        return $this;
    }
605048
public function setOrderBy($field, $direction = null)
    {
        if (empty($field))
            return $this;

        if (count($order = explode(' ', $field)) == 2) {
            $field = $order[0];
            $direction = $order[1];
        }
        $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction;
        return $this;
    }
416464
public function orHavingIs(string $column)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->orHavingIs($column);

        return $instance;
    }
75621
public function orderBy($field, $direction = 1)
    {
        if (is_string($direction)) {
            $direction = $direction === 'asc' ? 1 : -1;
        }

        $this->orderBy[$field] = $direction;

        return $this;
    }
689108
public function orderBy($column, $direction = 'asc')
	{
		$direction = strtolower($direction) == 'asc' ? 'asc' : 'desc';

		$this->orders[] = compact('column', 'direction');

		return $this;
	}
1141726
public function sort($key, $direction=CanSort::ASC)
    {
        $this->bootCanSortMethodsOnce();
        $this->sorting[$key] = $direction;
        return $this;
    }
1029396
final public function distinct($column)
    {
        if (!is_array($column)) {
            $column = explode(',', $column);
        }
        $column = array_map([$this, 'formatColumn'], $column);

        $this->_sql['distinct'] = array_merge($this->_sql['distinct'], $column);
        return $this;
    }
716832
public function scopeSort(Builder $query, $column, $direction)
    {
        if (!in_array($column, $this->sortable)) {
            return $query;
        }

        return $query->orderBy($column, $direction);
    }
261469
public function distinct($column)
    {
        if (!is_null($this->select)) {
            $this->select .= " distinct `$column`";
        } else {
            $this->select = "distinct `$column`";
        }

        return $this;
    }
269466
private function _select($column)
    {
        if ($column === 'all' || $column == '*') {
            $this->selectColumns = $this->quoteIdentifier(
                    self::cyrus()->getTableName()
                ).'.*';
        } else {
            if (string_has($column, 'as') || string_has($column, 'AS')) {
                return $this->selectExpr($column);
            }

            $this->selectColumns = (string) str_replace(' ', '', $this->quoteIdentifier(explode(',', $column)));
        }

        return $this;
    }
412404
public function selectOnly(string $column, string ...$columns)
    {
        return $this->selectFrom($this, $column, ...$columns);
    }