Merge branch 'xjjdev'

This commit is contained in:
徐俊杰 2023-03-31 14:08:57 +08:00
commit 9fbc31fdd2

View File

@ -170,13 +170,11 @@ func (a *ArtistInfoUserProvider) GetUserMsg(ctx context.Context, req *artistInfo
func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, in *artistInfoUser.BindInviteInvitedAccountRequest) (res *artistInfoUser.BindInviteInvitedAccountRespond, err error) { func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, in *artistInfoUser.BindInviteInvitedAccountRequest) (res *artistInfoUser.BindInviteInvitedAccountRespond, err error) {
// 查询被邀请人是否存在 // 查询被邀请人是否存在
var invitedUser model.User var invitedUser model.User
if in.InvitedUserId == 0 { if err = db.DB.Debug().Where("invited_code = ? OR id = ?", in.InvitedCode, in.InvitedUserId).First(&invitedUser).Error; err != nil {
if err = db.DB.Debug().Where("invited_code = ? OR id = ?", in.InvitedCode, in.InvitedUserId).First(&invitedUser).Error; err != nil { if err == gorm.ErrRecordNotFound {
if err == gorm.ErrRecordNotFound { return nil, errors.New("被邀请人不存在")
return nil, errors.New("被邀请人不存在") } else {
} else { return nil, err
return nil, err
}
} }
} }
// 查询邀请人是否存在 // 查询邀请人是否存在