コード例 #1
0
        public object QueryActive([FromBody] ParamActiveInfo queryInfo)
        {
            if (queryInfo == null || !queryInfo.StartDate.HasValue || !queryInfo.EndDate.HasValue)
            {
                return(Json(new ResultModel(false, "时间条件不允许为null", null)));
            }

            if ((queryInfo.EndDate.Value.AddDays(1) - queryInfo.StartDate.Value).Days > 7)
            {
                return(Json(new ResultModel(false, "最多查询7天数据,请更改查询条件", null)));
            }

            var lstActives = statisticsProvider.QueryActiveBusinessClienter(queryInfo);

            return(new ResultModel(true, string.Empty, lstActives));
        }
コード例 #2
0
        public ActionResult Active()
        {
            DateTime startDate = DateTime.Now.AddDays(-7).Date;
            DateTime endDate   = DateTime.Now.AddDays(-1).Date;

            ViewBag.StartDate = startDate;
            ViewBag.EndDate   = endDate;

            ParamActiveInfo defaultParams = new ParamActiveInfo()
            {
                StartDate   = startDate,
                EndDate     = endDate,
                AsCityQuery = false,
            };

            var lstActiveInfo = statisticsProvider.QueryActiveBusinessClienter(defaultParams);

            ViewBag.LstActiveInfo = lstActiveInfo;

            return(View());
        }