日/周活跃度红点
This commit is contained in:
parent
c6329afb7e
commit
81b413fba4
@ -57,6 +57,21 @@ func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag
|
||||
return list
|
||||
}
|
||||
|
||||
// 查询完成的且未领取的任务 发现未领取返回true
|
||||
func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTag) (bool, error) {
|
||||
list := []*pb.DBTaskActive{}
|
||||
if err := this.GetList(uid, &list); err != nil {
|
||||
this.moduleTask.Errorf("getUserActiveList err:%v", err)
|
||||
return false,err
|
||||
}
|
||||
for _, v := range list {
|
||||
if v.Tag == int32(taskTag) && v.Received == 0 {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
//获取玩家活跃记录 id 唯一ID
|
||||
func (this *ModelTaskActive) getUserActive(uid, id string, taskTag comm.TaskTag) *pb.DBTaskActive {
|
||||
record := this.getActiveListByTag(uid, taskTag)
|
||||
|
@ -23,14 +23,10 @@ type ModuleTask struct {
|
||||
modelTaskActive *ModelTaskActive
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
|
||||
// taskHandleMap map[int32]taskHandle //任务处理器
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &ModuleTask{
|
||||
// taskHandleMap: make(map[int32]taskHandle),
|
||||
}
|
||||
return &ModuleTask{}
|
||||
}
|
||||
|
||||
func (this *ModuleTask) GetType() core.M_Modules {
|
||||
@ -43,7 +39,6 @@ func (this *ModuleTask) GetEventApp() *event_v2.App {
|
||||
|
||||
func (this *ModuleTask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
// this.initTaskHandle()
|
||||
return
|
||||
}
|
||||
|
||||
@ -163,6 +158,14 @@ func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType
|
||||
reddot[comm.Reddot4] = ok
|
||||
break
|
||||
}
|
||||
case comm.Reddot27:
|
||||
if ok,_:= this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_DAILY);ok{
|
||||
reddot[comm.Reddot27] = ok
|
||||
}
|
||||
case comm.Reddot28:
|
||||
if ok,_:= this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_WEEKLY);ok{
|
||||
reddot[comm.Reddot28] = ok
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user