diff --git a/modules/sociaty/api_cross_refuse.go b/modules/sociaty/api_cross_refuse.go index 170f5c777..454f1d52d 100644 --- a/modules/sociaty/api_cross_refuse.go +++ b/modules/sociaty/api_cross_refuse.go @@ -43,7 +43,20 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SociatyRefuseReq) } return } - + // 判断改用户是否在申请记录中 + var flag bool + for _, r := range sociaty.GetApplyRecord() { + if r.Uid == req.Uid { + flag = true + break + } + } + if !flag { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_SociatyApplyCancel, + Title: pb.ErrorCode_SociatyApplyCancel.ToString(), + } + } // 已是公会成员 if this.module.modelSociaty.isMember(uid, sociaty) { errdata = &pb.ErrorData{ diff --git a/modules/sociaty/model_sociaty.go b/modules/sociaty/model_sociaty.go index b39d070c0..312e6beec 100644 --- a/modules/sociaty/model_sociaty.go +++ b/modules/sociaty/model_sociaty.go @@ -487,7 +487,7 @@ func (this *ModelSociaty) agree(uid string, sociaty *pb.DBSociaty) error { if this.isMember(uid, sociaty) { return comm.NewCustomError(pb.ErrorCode_SociatyBelongTo) } - + // 判断改用户是否在申请记录中 var flag bool for _, r := range sociaty.GetApplyRecord() { diff --git a/modules/sociaty/model_sociatytask.go b/modules/sociaty/model_sociatytask.go index 815be10e9..a146433fc 100644 --- a/modules/sociaty/model_sociatytask.go +++ b/modules/sociaty/model_sociatytask.go @@ -115,13 +115,13 @@ func (this *ModelSociatyTask) activityReceive(id int32, sociatyId, uid string) e break } } - if isUpdate { - update := map[string]interface{}{ - "activityList": sociatyTask.ActivityList, - } - return this.ChangeList(sociatyId, uid, update) + if !isUpdate { + sociatyTask.ActivityList = append(sociatyTask.ActivityList, &pb.SociatyActivity{Id: id, Status: 1}) } - return nil + update := map[string]interface{}{ + "activityList": sociatyTask.ActivityList, + } + return this.ChangeList(sociatyId, uid, update) } // 更新任务列表