From f44ba4009825da595132ff515667e93c52c7a670 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 7 Jul 2023 10:23:54 +0800 Subject: [PATCH] fix: update add model --- pkg/common/db/relation/user_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/relation/user_model.go b/pkg/common/db/relation/user_model.go index da62ffff8..66bcb3f7d 100644 --- a/pkg/common/db/relation/user_model.go +++ b/pkg/common/db/relation/user_model.go @@ -25,7 +25,7 @@ func (u *UserGorm) Create(ctx context.Context, users []*relation.UserModel) (err // 更新用户信息 零值 func (u *UserGorm) UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) { - return utils.Wrap(u.db(ctx).Where("user_id = ?", userID).Updates(args).Error, "") + return utils.Wrap(u.db(ctx).Model(&relation.UserModel{}).Where("user_id = ?", userID).Updates(args).Error, "") } // 更新多个用户信息 非零值