move dir and add ut for ParseOrder
This commit is contained in:
@@ -16,7 +16,8 @@ package orm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/astaxie/beego/client/orm/structs/clauses"
|
||||
"github.com/astaxie/beego/client/orm/structs"
|
||||
"github.com/astaxie/beego/client/orm/structs/clauses/order"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@@ -422,7 +423,7 @@ func (t *dbTables) getGroupSQL(groups []string) (groupSQL string) {
|
||||
}
|
||||
|
||||
// generate order sql.
|
||||
func (t *dbTables) getOrderSQL(orders []*clauses.Order) (orderSQL string) {
|
||||
func (t *dbTables) getOrderSQL(orders []*order.Order) (orderSQL string) {
|
||||
if len(orders) == 0 {
|
||||
return
|
||||
}
|
||||
@@ -432,7 +433,7 @@ func (t *dbTables) getOrderSQL(orders []*clauses.Order) (orderSQL string) {
|
||||
orderSqls := make([]string, 0, len(orders))
|
||||
for _, order := range orders {
|
||||
column := order.GetColumn()
|
||||
clause := strings.Split(column, clauses.ExprDot)
|
||||
clause := strings.Split(column, structs.ExprDot)
|
||||
|
||||
if order.IsRaw() {
|
||||
if len(clause) == 2 {
|
||||
|
||||
Reference in New Issue
Block a user