Example #1
0
        public ActionResult RechargeList(string mobile = "", string suite = "-1", string platform = "全部", string starttime = "", string endtime = "", int pageSize = 15, int pageNumber = 1)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" where 1=1 ");
            if (mobile != "")
            {
                strb.Append(" and a.account like '" + mobile + "%' ");
            }
            if (suite != "-1")
            {
                strb.Append(" and a.vossuiteid = " + suite + " ");
            }
            if (platform != "全部")
            {
                strb.Append(" and a.platform = '" + platform + "' ");
            }
            if (starttime != "" && endtime != "")
            {
                strb.Append(" and (convert(varchar(10),a.paytime,120) between '" + starttime + "' and '" + endtime + "')");
            }
            strb.Append(" order by a.addtime desc ");

            List <RechargeModel> rechargelist = Recharge.GetRechargeList(pageNumber, pageSize, strb.ToString());
            RechargeListModel    model        = new RechargeListModel()
            {
                RechargeList = rechargelist,
                PageModel    = new PageModel(pageSize, pageNumber, rechargelist.Count > 0 ? rechargelist[0].TotalCount : 0),
                Mobile       = mobile,
                Suite        = suite,
                PlatForm     = platform,
                StartTime    = starttime,
                EndTime      = endtime
            };

            return(View(model));
        }