示例#1
0
        public ActionResult StaticWalletTotal(int type)
        {
            var to = DateTime.Now.TotalSeconds();
            var fr = DateTime.Today.TotalSeconds();

            if (type == 1)
            {
                fr = DateTime.Today.AddDays(-7).TotalSeconds();
            }
            if (type == 2)
            {
                fr = DateTime.Today.AddMonths(-1).TotalSeconds();
            }
            if (type == 3)
            {
                fr = DateTime.Today.AddMonths(-3).TotalSeconds();
            }
            if (type == 4)
            {
                fr = DateTime.Today.AddMonths(-6).TotalSeconds();
            }
            if (type == 5)
            {
                fr = DateTime.Today.AddYears(-1).TotalSeconds();
            }
            var model = _agencyDa.GetStaticChartsTotal(CustomerId, fr, to);

            return(Json(new BaseResponse <StaticWalletsTotal>()
            {
                Code = 200, Data = model != null ? model : new StaticWalletsTotal()
                {
                    Total = 0, TotalAgency = 0, TotalSouce = 0, TotalCustomer = 0, Percent = 0, DateCreate = DateTime.Now.TotalSeconds()
                }
            }, JsonRequestBehavior.AllowGet));
        }