同步工会bug

This commit is contained in:
liwei 2023-07-13 17:12:48 +08:00
parent 1c070e2646
commit f97e1ac79a
3 changed files with 21 additions and 8 deletions

View File

@ -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{

View File

@ -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)
}
// 更新任务列表