From efbca8b48b8e842041bb69208ee124a76a39142b Mon Sep 17 00:00:00 2001 From: hupeh Date: Wed, 4 Jan 2023 00:17:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E8=BF=BD=E8=B8=AA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=93=8D=E4=BD=9C=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/rts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/rts.go b/app/rts.go index 0e678bb..0961e89 100644 --- a/app/rts.go +++ b/app/rts.go @@ -436,7 +436,7 @@ func GetGoodsList(w *ResponseWriter, r *Request) { var total int64 var err error if err = DB.Scopes(search).Count(&total).Error; err == nil { - err = DB.Scopes(search).Find(&goodsList).Error + err = DB.Scopes(search).Preload("Creator").Preload("Updater").Find(&goodsList).Error } if err != nil { w.Error(err) @@ -463,7 +463,7 @@ func GetGoodsPrices(w *ResponseWriter, r *Request) { args = append(args, val) } if len(queries) == 0 { - return db.Preload("Prices") + return db.Preload("Prices.Creator") } args = append([]any{strings.Join(queries, " AND ")}, args...) return db.Preload("Prices", args...)