public IActionResult GetList(NewsRequestPayload payload) { using (_dbContext) { var query = from p in _dbContext.ExternalLink where p.IsDeleted != 1 orderby p.Id ascending select new { p.ExternalLinkUuid, p.Link, p.IsDeleted, p.Staue, p.Remark }; if (!string.IsNullOrEmpty(payload.Kw)) { query = query.Where(x => x.Link.Contains(payload.Kw.Trim())); } var list = query.Paged(payload.CurrentPage, payload.PageSize).ToList(); var totalCount = query.Count(); var response = ResponseModelFactory.CreateResultInstance; response.SetData(list, totalCount); ToLog.AddLog("查询", "成功:查询:外部链接列表信息数据", _dbContext); return(Ok(response)); } }
public IActionResult List(NewsRequestPayload payload) { using (_dbContext) { var query = _dbContext.Content.Where(x => x.ColumnModel == "列表栏目" && x.SuperiorUuid != null && x.SuperiorMenu != 1); if (!string.IsNullOrEmpty(payload.Kw)) { query = query.Where(x => x.ColumnTitle.Contains(payload.Kw.Trim())); } if (!string.IsNullOrEmpty(payload.Kw1)) { query = query.Where(x => x.SuperiorUuid == Guid.Parse(payload.Kw1.Trim())); } if (payload.Staue > -1) { query = query.Where(x => x.Staue == payload.Staue.ToString()); } if (payload.IsDeleted > CommonEnum.IsDeleted.All) { query = query.Where(x => x.IsDeleted == Convert.ToInt32(((CommonEnum.IsDeleted)payload.IsDeleted))); } query = query.OrderByDescending(x => x.IsStick).ThenByDescending(x => x.Id); var list = query.Paged(payload.CurrentPage, payload.PageSize).ToList(); var totalCount = query.Count(); var response = ResponseModelFactory.CreateResultInstance; response.SetData(list, totalCount); ToLog.AddLog("查询", "成功:查询:内容管理信息数据", _dbContext); return(Ok(response)); } }
public IActionResult List(NewsRequestPayload payload) { using (_dbContext) { var query = from p in _dbContext.Proclamation where p.IsDeleted != 1 orderby p.Id ascending select new { p.ProclamationUuid, p.ProclamationTitle, p.IsDeleted, p.SortId, p.ProclamationContent, p.Staue, p.IsStick }; if (!string.IsNullOrEmpty(payload.Kw)) { query = query.Where(x => x.ProclamationTitle.Contains(payload.Kw.Trim())); } query = query.OrderByDescending(x => x.IsStick).ThenBy(x => x.SortId); var list = query.Paged(payload.CurrentPage, payload.PageSize).ToList(); var totalCount = query.Count(); var response = ResponseModelFactory.CreateResultInstance; response.SetData(list, totalCount); ToLog.AddLog("查询", "成功:查询:通知公告列表信息数据", _dbContext); return(Ok(response)); } }
public IActionResult List(NewsRequestPayload payload) { using (_dbContext) { var query = _dbContext.RestsData.Where(x => x.IsDeleted != 1); if (!string.IsNullOrEmpty(payload.Kw)) { query = query.Where(x => x.Name.Contains(payload.Kw.Trim())); } var list = query.Paged(payload.CurrentPage, payload.PageSize).ToList(); var totalCount = query.Count(); var response = ResponseModelFactory.CreateResultInstance; response.SetData(list, totalCount); ToLog.AddLog("查询", "成功:查询:其他数据信息数据", _dbContext); return(Ok(response)); } }
public IActionResult List(NewsRequestPayload payload) { using (_dbContext) { var query = from p in _dbContext.News //where p.IsDeleted != 1 orderby p.Id ascending select new { p.NewsUuid, p.NewsTitle, p.NewSubhead, p.SortId, p.NewsUrl, p.IsDeleted, p.Staue, p.IsStick }; if (!string.IsNullOrEmpty(payload.Kw)) { query = query.Where(x => x.NewsTitle.Contains(payload.Kw.Trim())); } if (payload.Staue > -1) { query = query.Where(x => x.Staue == payload.Staue); } if (payload.IsDeleted > CommonEnum.IsDeleted.All) { query = query.Where(x => x.IsDeleted == Convert.ToInt32(((CommonEnum.IsDeleted)payload.IsDeleted))); } query = query.OrderByDescending(x => x.IsStick).ThenByDescending(x => x.NewsUrl); var list = query.Paged(payload.CurrentPage, payload.PageSize).ToList(); var totalCount = query.Count(); var response = ResponseModelFactory.CreateResultInstance; response.SetData(list, totalCount); ToLog.AddLog("查询", "成功:查询:新闻列表信息数据", _dbContext); return(Ok(response)); } }