feat: 追踪数据操作者

main
熊二 2 years ago
parent 645326b148
commit efbca8b48b
  1. 4
      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...)

Loading…
Cancel
Save