add order clause

This commit is contained in:
Anker Jam
2020-10-25 21:07:03 +08:00
parent 9524036aab
commit 9bd2934e42
4 changed files with 64 additions and 11 deletions

View File

@@ -58,6 +58,7 @@ import (
"database/sql"
"errors"
"fmt"
"github.com/astaxie/beego/client/orm/structs"
"os"
"reflect"
"time"
@@ -351,7 +352,7 @@ func (o *ormBase) LoadRelatedWithCtx(ctx context.Context, md interface{}, name s
qs.relDepth = relDepth
if len(order) > 0 {
qs.orders = []string{order}
qs.orders = structs.ParseOrderClause(order)
}
find := ind.FieldByIndex(fi.fieldIndex)