Example #1
0
        public ActionResult Index(int pageIndex, int pageSize, string queryDate, string keyWord)
        {
            DateTime limitDate = DateTime.Now.StartDateTime();

            if (!queryDate.IsNullOrEmpty())
            {
                switch (queryDate)
                {
                case "7":
                    limitDate = DateTime.Now.AddDays(-7).StartDateTime();
                    break;

                case "30":
                    limitDate = DateTime.Now.AddMonths(-1).StartDateTime();
                    break;

                case "90":
                    limitDate = DateTime.Now.AddMonths(-3).StartDateTime();
                    break;

                default:
                    limitDate = DateTime.Now.StartDateTime();
                    break;
                }
            }
            int totalCount = 0;
            var pageData   = logLogic.GetList(pageIndex, pageSize, limitDate, keyWord, ref totalCount);
            var result     = new LayPadding <SysLog>()
            {
                result = true,
                msg    = "success",
                list   = pageData,
                count  = totalCount//pageData.Count
            };

            return(Content(result.ToJson()));
        }