From 17a1dd464833d5236afb62e4a3f27487ffcfecef Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Thu, 30 Mar 2023 14:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E8=AF=81=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/controller/artistInfo_user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/internal/controller/artistInfo_user.go b/cmd/internal/controller/artistInfo_user.go index 91dd69d..cdb9c69 100644 --- a/cmd/internal/controller/artistInfo_user.go +++ b/cmd/internal/controller/artistInfo_user.go @@ -9,6 +9,7 @@ import ( "github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser" db "github.com/fonchain/fonchain-artistinfo/pkg/db" "gorm.io/gorm" + "gorm.io/gorm/clause" "github.com/fonchain/fonchain-artistinfo/cmd/internal/logic" ) @@ -82,7 +83,7 @@ func (a *ArtistInfoUserProvider) UpdateIdCard(ctx context.Context, in *artistInf if in.Birthday != "" { thisUser.RealNameInfo.Birthday = in.Birthday } - err = db.DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&thisUser).Error + err = db.DB.Session(&gorm.Session{FullSaveAssociations: true}).Clauses(clause.OnConflict{UpdateAll: true}).Save(&thisUser).Error return }