Commit 4979bec2 authored by chenweijian's avatar chenweijian

派对申请

parent 05f8aa0a
......@@ -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
}
......
......@@ -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
......
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