From 4979bec2e0f79c756cb9a5978b9516d17fec4f31 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Mon, 10 Jul 2023 17:41:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BE=E5=AF=B9=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/invite_m/invite_apply.go | 4 ++-- route/invite_r/party_invite.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index 2f584e6..d7389f6 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 38699ee..eff5981 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 -- 2.22.0