diff --git a/modules/reddot/api_getall.go b/modules/reddot/api_getall.go index 7d522f985..d6b8eda7a 100644 --- a/modules/reddot/api_getall.go +++ b/modules/reddot/api_getall.go @@ -21,7 +21,8 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success { return } - for k, v := range this.module.ModuleTask.Reddot(session, comm.Reddot1, comm.Reddot2, comm.Reddot3, comm.Reddot4) { + for k, v := range this.module.ModuleTask.Reddot(session, comm.Reddot1, comm.Reddot2, comm.Reddot4, comm.Reddot27, + comm.Reddot28) { reddot[int32(k)] = v } for k, v := range this.module.mainline.Reddot(session, comm.Reddot5) { @@ -42,6 +43,10 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) for k, v := range this.module.gourmet.Reddot(session, comm.Reddot20, comm.Reddot21, comm.Reddot22) { reddot[int32(k)] = v } + + for k, v := range this.module.sociaty.Reddot(session, comm.Reddot3, comm.Reddot29) { + reddot[int32(k)] = v + } // for k, v := range this.module.mail.Reddot(session, comm.Reddot26) { // reddot[int32(k)] = v // } diff --git a/modules/reddot/module.go b/modules/reddot/module.go index 82b609e12..983cfef19 100644 --- a/modules/reddot/module.go +++ b/modules/reddot/module.go @@ -26,6 +26,7 @@ type Reddot struct { horoscope comm.IHoroscope arena comm.IArena gourmet comm.IGourmet + sociaty comm.ISociaty // mail comm.Imail api_comp *apiComp } @@ -68,6 +69,11 @@ func (this *Reddot) Start() (err error) { return } this.gourmet = module.(comm.IGourmet) + + if module, err = this.service.GetModule(comm.ModuleSociaty); err != nil { + return + } + this.sociaty = module.(comm.ISociaty) // if module, err = this.service.GetModule(comm.ModuleMail); err != nil { // return // } diff --git a/modules/sociaty/module.go b/modules/sociaty/module.go index f8e367fe7..080dd1ada 100644 --- a/modules/sociaty/module.go +++ b/modules/sociaty/module.go @@ -124,29 +124,32 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) ( sociaty := this.modelSociaty.getUserSociaty(session.GetUserId()) if sociaty == nil || sociaty.Id == "" { log.Warn("公会红点未获得公会信息", log.Fields{"uid": session.GetUserId()}) - return - } - - var applyReddot bool - if this.modelSociaty.isRight(session.GetUserId(), sociaty, - pb.SociatyJob_PRESIDENT, - pb.SociatyJob_VICEPRESIDENT, - pb.SociatyJob_ADMIN) { - - if len(sociaty.ApplyRecord) > 0 { - applyReddot = true + for _, v := range rid { + reddot[v] = false } - return - } - for _, v := range rid { - switch v { - case comm.Reddot3: - tf := this.modelSociaty.IsSign(session.GetUserId(), sociaty) - reddot[comm.Reddot3] = tf - case comm.Reddot29: - reddot[comm.Reddot29] = applyReddot + } else { + var applyReddot bool + if this.modelSociaty.isRight(session.GetUserId(), sociaty, + pb.SociatyJob_PRESIDENT, + pb.SociatyJob_VICEPRESIDENT, + pb.SociatyJob_ADMIN) { + + if len(sociaty.ApplyRecord) > 0 { + applyReddot = true + } + return + } + for _, v := range rid { + switch v { + case comm.Reddot3: + tf := this.modelSociaty.IsSign(session.GetUserId(), sociaty) + reddot[comm.Reddot3] = tf + case comm.Reddot29: + reddot[comm.Reddot29] = applyReddot + } } } + return }