diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index 2f584e6d16c508ce45d7a9da49d485f45c3272aa..d7389f60cf6eb0a1abc0199eaa05d2dc387285b4 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, status int) (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 = ? and status = ?", userId, status).First(&apply).Error; err != nil { + if err := model.Db.Model(InviteApply{}).Where("new_user_id = ? and status in (?)", 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 38699ee1d48fe8c83739c517f815c43c8b98ab18..eff59815e565c20201d99eb8caf95999553cb801 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, 1) + isApply, err := invite_m.IsInInviteApply(model, newUser.ID, []int{0, 1}) if err != nil { model.Log.Errorf("InviteApply param:%v, err:%v", param, err) return myCtx, err