1
0
mirror of https://github.com/beego/bee.git synced 2024-11-10 15:00:54 +00:00

Update g_model.go

This commit is contained in:
Shimon 2019-07-12 08:19:07 +08:00 committed by GitHub
parent e86aad1be3
commit cfc1d07061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,9 +232,9 @@ func GetAll{{modelName}}(query map[string]string, fields []string, sortby []stri
} }
var l []{{modelName}} var l []{{modelName}}
var list []interface{}
qs = qs.OrderBy(sortFields...).RelatedSel() qs = qs.OrderBy(sortFields...).RelatedSel()
if _, err = qs.Limit(limit, offset).All(&l, fields...); err == nil { if _, err = qs.Limit(limit, offset).All(&l, fields...); err == nil {
var list []interface{}
if len(fields) == 0 { if len(fields) == 0 {
for _, v := range l { for _, v := range l {
list = append(list, v) list = append(list, v)