diff --git a/cmd/internal/controller/artistInfo_user.go b/cmd/internal/controller/artistInfo_user.go index 6d575e2..18fd6fb 100644 --- a/cmd/internal/controller/artistInfo_user.go +++ b/cmd/internal/controller/artistInfo_user.go @@ -168,12 +168,12 @@ func (a *ArtistInfoUserProvider) GetUserMsg(ctx context.Context, req *artistInfo // 绑定邀请人和受邀请人的账号,并加入到次数统计 func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, in *artistInfoUser.BindInviteInvitedAccountRequest) (res *artistInfoUser.BindInviteInvitedAccountRespond, err error) { - // 查询受邀请人是否存在 + // 查询邀请人是否存在 var thisUser model.User if in.InvitedUserId == 0 { - if err = db.DB.Where("id = ? AND invite_code = ?", in.InvitedUserId, in.InviteCode).First(&thisUser).Error; err != nil { + if err = db.DB.Where("invited_code = ?", in.InviteCode).First(&thisUser).Error; err != nil { if err == gorm.ErrRecordNotFound { - return nil, errors.New("受邀请人不存在") + return nil, errors.New("邀请人不存在") } else { return nil, err }