public async Task <JsonResult> GetPagingLoginLog(SystemLoginLogGetPagingInput paging) { var list = new List <FilterDefinition <SystemLoginLog> > { Builders <SystemLoginLog> .Filter.Lt("CreateTime", DateTime.Now) }; if (!paging.Name.IsNullOrEmpty()) { list.Add(Builders <SystemLoginLog> .Filter.Where(w => w.CreateUserName.Contains(paging.Name))); } if (!paging.Code.IsNullOrEmpty()) { list.Add(Builders <SystemLoginLog> .Filter.Where(w => w.CreateUserCode.Contains(paging.Code))); } if (!paging.CreateTime.IsNullOrEmpty()) { list.Add(Builders <SystemLoginLog> .Filter.Where(w => w.CreateTime <= paging.EndCreateTime && w.CreateTime >= paging.BeginCreateTime)); } var filter = Builders <SystemLoginLog> .Filter.And(list); var sort = Builders <SystemLoginLog> .Sort.Descending(d => d.CreateTime); var datas = await _loginLogLogic.PagingQueryProcAsync(filter, paging, sort); foreach (var data in datas.Data) { data.CreateTime = TimeZone.CurrentTimeZone.ToLocalTime(data.CreateTime); } return(JsonForGridPaging(datas)); }
public async Task <JsonResult> GetPagingLoginLog(QueryParam paging) { return(JsonForGridPaging(await _loginLogLogic.PagingQueryProcAsync(paging))); }