diff --git a/client/orm/db_tables.go b/client/orm/db_tables.go index 7c6e6fff..5c330f4e 100644 --- a/client/orm/db_tables.go +++ b/client/orm/db_tables.go @@ -434,9 +434,9 @@ func (t *dbTables) getOrderSQL(orders []*clauses.Order) (orderSQL string) { column := order.GetColumn() var sort string switch order.GetSort() { - case clauses.ASCENDING: + case clauses.SortAscending: sort = "ASC" - case clauses.DESCENDING: + case clauses.SortDescending: sort = "DESC" } clause := strings.Split(column, ExprSep) diff --git a/client/orm/structs/clauses/order.go b/client/orm/structs/clauses/order.go index 050bcf1b..66e8fe73 100644 --- a/client/orm/structs/clauses/order.go +++ b/client/orm/structs/clauses/order.go @@ -3,8 +3,9 @@ package clauses type Sort int8 const ( - ASCENDING Sort = 1 - DESCENDING Sort = 2 + SortNone Sort = 0 + SortAscending Sort = 1 + SortDescending Sort = 2 ) type Order struct { @@ -23,10 +24,10 @@ func (o *Order) GetSort() Sort { func ParseOrder(expressions ...string) []*Order { var orders []*Order for _, expression := range expressions { - sort := ASCENDING + sort := SortAscending column := expression if expression[0] == '-' { - sort = DESCENDING + sort = SortDescending column = expression[1:] }