diff --git a/pkg/common/db/relation/user_model.go b/pkg/common/db/relation/user_model.go index 4de1784a7..b99cc2539 100644 --- a/pkg/common/db/relation/user_model.go +++ b/pkg/common/db/relation/user_model.go @@ -13,12 +13,11 @@ type UserGorm struct { } func NewUserGorm(db *gorm.DB) relation.UserModelInterface { - return &UserGorm{DB: db.Model(&relation.UserModel{})} + return &UserGorm{DB: db} } func (u *UserGorm) db() *gorm.DB { - newDB := *u.DB - return &newDB + return u.DB.Model(&relation.UserModel{}) } // 插入多条