From ff011f64525344b02607da0ef8268ddb8ef58a17 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Thu, 21 Sep 2023 23:32:58 +0800 Subject: [PATCH] fix --- model/gmodel/fs_user_logic.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/model/gmodel/fs_user_logic.go b/model/gmodel/fs_user_logic.go index 09dd8d58..edb3fc2c 100644 --- a/model/gmodel/fs_user_logic.go +++ b/model/gmodel/fs_user_logic.go @@ -68,7 +68,7 @@ func InheritGuestIdResource(tx *gorm.DB, userId, guestId int64, afterDo func(txR Where("guest_id = ?", guestId). UpdateColumn("user_id", userId).Error if err != nil && err != gorm.ErrRecordNotFound { - logx.Info(err, "找到user_id1 afterDo") + return err } @@ -77,16 +77,16 @@ func InheritGuestIdResource(tx *gorm.DB, userId, guestId int64, afterDo func(txR UpdateColumn("user_id", userId).Error if err != nil && err != gorm.ErrRecordNotFound { - logx.Info(err, "找到user_id1 afterDo") + return err } err = txUserInfo. Where("guest_id = ?", guestId). UpdateColumn("user_id", userId).Error - + logx.Info(err, "guest_id = ", guestId) if err != nil && err != gorm.ErrRecordNotFound { - logx.Info(err, "找到user_id1 afterDo") + return err } } @@ -225,9 +225,11 @@ func (u *FsUserModel) RegisterByFusen(ctx context.Context, token *auth.RegisterT // txUserInfo.Statement.Table if err != nil { - logx.Info(err) + if err == gorm.ErrRecordNotFound { + logx.Info(err) err = txUserInfo.Create(uinfo).Error + logx.Info(err) if err == gorm.ErrRecordNotFound { return nil }