This commit is contained in:
wh_zcy 2022-11-21 18:49:18 +08:00
commit e75f63b070
2 changed files with 48 additions and 0 deletions

View File

@ -131,3 +131,31 @@ func (this *modelMail) MailQueryUserMailByReard(uId string) (mail []*pb.DBMailDa
}
return
}
//附件红点
func (this *modelMail) checkReddot26(uid string) bool {
mailinfo, err := this.MailQueryUserMail(uid)
if err != nil {
return false
}
for _, v := range mailinfo {
if v.Reward && len(v.Items) > 0 {
return true
}
}
return false
}
// 未读红点
func (this *modelMail) checkReddot30(uid string) bool {
mailinfo, err := this.MailQueryUserMail(uid)
if err != nil {
return false
}
for _, v := range mailinfo {
if !v.Check {
return true
}
}
return false
}

View File

@ -121,3 +121,23 @@ func (this *Mail) SendNewMail(mail *pb.DBMailData, uid ...string) bool {
}
return true
}
//红点查询
func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
for _, v := range rid {
switch v {
case comm.Reddot26:
if isredot := this.modelMail.checkReddot26(session.GetUserId()); isredot {
reddot[comm.Reddot26] = true
}
break
case comm.Reddot30:
if isredot := this.modelMail.checkReddot30(session.GetUserId()); isredot {
reddot[comm.Reddot30] = true
}
break
}
}
return
}