public string QueryLog(int page, int rows) { var now = DateTime.Now; var vm = LoggingTo.Query(now.AddYears(-5), now, page, rows); return(new { data = vm.Data, total = vm.Total, lost = vm.Lost }.ToJson()); }
public string QueryLog(int page, int rows, string wheres) { var now = DateTime.Now; List <List <string> > listWhere = new(); try { if (!string.IsNullOrWhiteSpace(wheres)) { var jws = JArray.Parse(wheres); foreach (var wi in jws) { var w1 = wi[0]?.ToString(); var w2 = wi[1]?.ToString(); var w3 = wi[2]?.ToString(); if (!string.IsNullOrWhiteSpace(w2) && !string.IsNullOrWhiteSpace(w3)) { listWhere.Add(new List <string> { w1, w2, w3 }); } } } } catch (Exception ex) { Console.WriteLine(ex); listWhere = null; } var vm = LoggingTo.Query(now.AddYears(-5), now, page, rows, listWhere); return(new { data = vm.Data, total = vm.Total, lost = vm.Lost }.ToJson()); }