diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index c4ac01758a3b8ecbf5ade092ea41f248493301c1..2f584e6d16c508ce45d7a9da49d485f45c3272aa 100644 --- a/domain/model/invite_m/invite_apply.go +++ b/domain/model/invite_m/invite_apply.go @@ -52,9 +52,9 @@ func GetApplyList(model *domain.Model, userIds []uint64, pageIndex, pageSize, gT } // 检查被邀请人是否存在 -func IsInInviteApply(model *domain.Model, userId mysql.ID) (bool, error) { +func IsInInviteApply(model *domain.Model, userId mysql.ID, status int) (bool, error) { var apply InviteApply - if err := model.Db.Model(InviteApply{}).Where("new_user_id = ?", userId).First(&apply).Error; err != nil { + if err := model.Db.Model(InviteApply{}).Where("new_user_id = ? and status = ?", userId, status).First(&apply).Error; err != nil { if err != gorm.ErrRecordNotFound { return false, err } diff --git a/route/invite_r/party_invite.go b/route/invite_r/party_invite.go index d3a8612efbbc1567a04fab79eeda91c45ffee665..38699ee1d48fe8c83739c517f815c43c8b98ab18 100644 --- a/route/invite_r/party_invite.go +++ b/route/invite_r/party_invite.go @@ -86,7 +86,7 @@ func InviteApply(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, bizerr.InviteApplyNoPermission } // 被邀请人是否已经被人提交过申请 - isApply, err := invite_m.IsInInviteApply(model, newUser.ID) + isApply, err := invite_m.IsInInviteApply(model, newUser.ID, 1) if err != nil { model.Log.Errorf("InviteApply param:%v, err:%v", param, err) return myCtx, err