Merge branch 'xjjdev'
This commit is contained in:
commit
ef12a59096
@ -169,8 +169,8 @@ func (a *ArtistInfoUserProvider) GetUserMsg(ctx context.Context, req *artistInfo
|
||||
// 绑定邀请人和受邀请人的账号,并加入到次数统计
|
||||
func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, in *artistInfoUser.BindInviteInvitedAccountRequest) (res *artistInfoUser.BindInviteInvitedAccountRespond, err error) {
|
||||
// 查询受邀请人是否存在
|
||||
if in.InvitedUserId == 0 {
|
||||
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 == gorm.ErrRecordNotFound {
|
||||
return nil, errors.New("受邀请人不存在")
|
||||
@ -186,6 +186,7 @@ func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, i
|
||||
}
|
||||
if data.ID == 0 {
|
||||
data = model.Invite{
|
||||
UserId: int32(thisUser.ID),
|
||||
InvitedId: in.InvitedUserId,
|
||||
InvitedCode: in.InvitedCode,
|
||||
InviteCode: in.InviteCode,
|
||||
@ -202,6 +203,7 @@ func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, i
|
||||
}
|
||||
if countData.ID == 0 {
|
||||
countData = model.UserInvited{
|
||||
UserId: int32(thisUser.ID),
|
||||
InvitedUserId: in.InvitedUserId, //受邀请人的画家宝用户id
|
||||
Count: 1,
|
||||
InvitedCode: in.InvitedCode,
|
||||
|
Loading…
Reference in New Issue
Block a user