/// <summary> /// /// </summary> /// <returns></returns> public override Task OnConnected() { //未读 var item = _iSysBroadcastService.GetAll(a => (a.AddresseeId == null || a.AddresseeId == _iUserInfoService.UserId) && a.SysBroadcastReceiveds.All(b => b.CreatedBy != _iUserInfoService.UserId)).Count(); if (item > 0) { Clients.Client(Context.ConnectionId).add("您有" + item + "条新的管理信息"); } var date = DateTime.Now.AddDays(-1); _iSysSignalROnlineService.Delete(a => a.GroupId == GroupId && a.CreatedBy == _iUserInfoService.UserId); _iSysSignalROnlineService.Save(null, new SysSignalROnline { ConnectionId = Context.ConnectionId, GroupId = GroupId }); _iUnitOfWork.Commit(); return(base.OnConnected()); }
// GET: Platform/MyMessage /// <summary> /// 我收到的消息列表 /// </summary> /// <returns></returns> public ActionResult Index(string keyword, int pageIndex = 1) { var model = _iSysBroadcastService.GetAll(a => (a.AddresseeId == null || a.AddresseeId.Contains(_iUserInfo.UserId)) && !a.SysBroadcastReceiveds.Any(b => b.CreatedBy == _iUserInfo.UserId && b.Deleted)).OrderBy(a => a.SysBroadcastReceiveds.Any(r => r.CreatedBy == _iUserInfo.UserId)).ThenByDescending(a => a.CreatedDate).Search(keyword); return(View(model.ToPagedList(pageIndex))); }
/// <summary> /// 消息提醒 /// </summary> /// <returns></returns> public ActionResult Index(int pageIndex = 1) { var model = _iSysBroadcastService.GetAll(t => t.AddresseeId == _iUserInfo.UserId).OrderByDescending(t => t.CreatedDate); return(View(model.ToPagedList(pageIndex))); }