This commit is contained in:
eson 2023-09-21 23:32:58 +08:00
parent d3c96184b8
commit ff011f6452

View File

@ -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
}