From 917b61de02c4e119132ce2b741cebd9ddab56e0b Mon Sep 17 00:00:00 2001 From: jjxu <428192774@qq.com> Date: Fri, 31 Mar 2023 14:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E6=95=B0=E6=8D=AE=E5=BA=93dsn?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/controller/artistInfo_user.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/internal/controller/artistInfo_user.go b/cmd/internal/controller/artistInfo_user.go index 85012f2..c99669d 100644 --- a/cmd/internal/controller/artistInfo_user.go +++ b/cmd/internal/controller/artistInfo_user.go @@ -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) { // 查询被邀请人是否存在 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 == gorm.ErrRecordNotFound { - return nil, errors.New("被邀请人不存在") - } else { - return nil, err - } + if err = db.DB.Debug().Where("invited_code = ? OR id = ?", in.InvitedCode, in.InvitedUserId).First(&invitedUser).Error; err != nil { + if err == gorm.ErrRecordNotFound { + return nil, errors.New("被邀请人不存在") + } else { + return nil, err } } // 查询邀请人是否存在