From cfc1d07061517544a007b44d91063f1d82e1d4db Mon Sep 17 00:00:00 2001 From: Shimon <45685994+wan2310@users.noreply.github.com> Date: Fri, 12 Jul 2019 08:19:07 +0800 Subject: [PATCH] Update g_model.go --- generate/g_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate/g_model.go b/generate/g_model.go index 178e924..7704c49 100644 --- a/generate/g_model.go +++ b/generate/g_model.go @@ -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)