作者 yangfu

互动消息 机会补充

... ... @@ -29,6 +29,9 @@ func (this DepartmentsResponse) GetRootDepartment() []*Department {
if len(this.Departments) == 0 {
return []*Department{}
}
if this.Departments[0].PId != 0 {
return []*Department{}
}
return this.Departments[0].Departments
}
... ...
... ... @@ -721,10 +721,9 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
defer func() {
if p := recover(); p != nil {
log.Error(p)
} else {
log.Debug("")
}
}()
//TODO:测试
if header.UserId == chance.UserId {
return
}
... ...
... ... @@ -51,6 +51,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent
interactionCount += item.MsgTotal
continue
}
if item.MsgType == protocol.MsgTypeChanceRevise {
interactionCount += item.MsgTotal
continue
}
if item.MsgType == protocol.MsgTypeBulletin {
var tmpTotal int
models.GetBulletinUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &tmpTotal)
... ... @@ -591,6 +595,7 @@ func MsgChanceRevise(header *protocol.RequestHeader, request *protocol.MsgChance
var (
myChances []protocol.ChanceReviseItemOrm
total int
provider *protocol.BaseUserInfo
)
if total, err = models.GetChanceReviseMsg(header.UserId, request.LastId, request.PageSize, protocol.MsgTypeChanceRevise, &myChances); err != nil {
... ... @@ -608,7 +613,11 @@ func MsgChanceRevise(header *protocol.RequestHeader, request *protocol.MsgChance
commItem := protocol.MsgCommonListItem{}
commItem.Chance, commItem.ChanceStatus = agg.SetChanceItem(header, chance.CommChanceItemOrm)
agg.SetMsgItem(header, chance.MsgItemOrm, &commItem)
if provider, err = agg.GetUserBaseInfo(chance.SenderUserId, header.CompanyId); err != nil {
log.Error(err)
return
}
commItem.Chance.Provider = provider
commItem.ChanceId = chance.ChanceId
commItem.ReviewStatus = chance.ReviewStatus
rsp.List = append(rsp.List, commItem)
... ...