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
1 changed files with 1 additions and 1 deletions

View File

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