标签:
/// <summary> /// 登陆用户已读消息 /// </summary> public dynamic ReadMessageList(int pageindex, int pagesize) { //系统消息已读 var readmassAll = AppMassMessageReadStatus.GetListBy( m => m.RecUserAccount == LoginUser.UserAccount && m.ReadMessageType == massAllType && m.MessageStatus == read).Select(m => m.TextId).ToList(); //角色消息已读 var readmassRole = AppMassMessageReadStatus.GetListBy( m => m.RecUserAccount == LoginUser.UserAccount && m.ReadMessageType == massRoleType && m.MessageStatus == read).Select(m => m.TextId).ToList(); //用户已读 var aloneUser = AppMessage.GetListBy( m => m.RecUserAccount == LoginUser.UserAccount && m.MessageType == aloneUserType && m.MessageStatus == read).Select(m => m.TextId).ToList(); var textidlist = new List<int>(); textidlist.AddRange(readmassAll); textidlist.AddRange(readmassRole); textidlist.AddRange(aloneUser); //通过所有已读消息ID,查询所有消息详细,并提供分页 int total = 0; var readlist = AppReadMessage.GetPagedList(pageindex, pagesize, ref total, m => textidlist.Contains(m.TextId), m => m.SendTime).ToList(); return new { total, list = readlist, pageCurrent = pageindex }; }
标签:
原文地址:http://www.cnblogs.com/oviovi/p/5669868.html