Commit 05f8aa0a authored by chenweijian's avatar chenweijian

派对申请

parent 823b8882
...@@ -52,9 +52,9 @@ func GetApplyList(model *domain.Model, userIds []uint64, pageIndex, pageSize, gT ...@@ -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 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 { if err != gorm.ErrRecordNotFound {
return false, err return false, err
} }
......
...@@ -86,7 +86,7 @@ func InviteApply(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -86,7 +86,7 @@ func InviteApply(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, bizerr.InviteApplyNoPermission return myCtx, bizerr.InviteApplyNoPermission
} }
// 被邀请人是否已经被人提交过申请 // 被邀请人是否已经被人提交过申请
isApply, err := invite_m.IsInInviteApply(model, newUser.ID) isApply, err := invite_m.IsInInviteApply(model, newUser.ID, 1)
if err != nil { if err != nil {
model.Log.Errorf("InviteApply param:%v, err:%v", param, err) model.Log.Errorf("InviteApply param:%v, err:%v", param, err)
return myCtx, err return myCtx, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment