作者 yangfu

消息修改

@@ -33,6 +33,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent @@ -33,6 +33,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent
33 } 33 }
34 } 34 }
35 err = models.GetUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &rsp.Totals) 35 err = models.GetUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &rsp.Totals)
  36 + if rsp.Totals == nil || len(rsp.Totals) == 0 {
  37 + rsp.Totals = make([]*protocol.MessageTotal, 0)
  38 + return
  39 + }
36 for i := range rsp.Totals { 40 for i := range rsp.Totals {
37 item := rsp.Totals[i] 41 item := rsp.Totals[i]
38 if item.MsgType == protocol.MsgTypeThumbUp { 42 if item.MsgType == protocol.MsgTypeThumbUp {