示例#1
0
        public async Task <JsonResult> GetRegionList(RegionVm model)
        {
            string strwhere = "1=1";

            if (model.Region != null && model.Region != "")
            {
                strwhere += $" and region={model.Region} or realregion={model.Region}";
            }
            model.Sql = $"select * from region_real where  " + strwhere;
            var result = await CommonRespository.GetQueryResult(_SqlDB, model);

            return(Json(result));
        }
        public async Task <JsonResult> GetMieShenList(MieShenVm model)
        {
            string strwhere = "1=1";

            if (model.UserName != null && model.UserName != "")
            {
                strwhere += $" and a.username='******'";
            }
            model.Sql = $"select * from region_real where  " + strwhere;
            model.Sql = @"select a.*,ISNULL(b.status,a.status) sta from mieshen_info  a left join mieshen_online b
on a.platfrom = b.platfrom and a.region = b.region and a.gamename = b.gamename and a.username = b.username where " + strwhere;
            var result = await CommonRespository.GetQueryResult(_SqlDB, model);

            return(Json(result));
        }
        public async Task <JsonResult> GetMieShenEveryList(MieShenEveryVm model)
        {
            string strwhere = "1=1";

            model.Sql = @"select * from mieshen_every ss  where ";


            if (model.Bdate != null && model.Bdate != "")
            {
                if (Convert.ToDateTime(model.Bdate).Date == DateTime.Now.Date)
                {
                    model.Sql = @" select * from (select aa.platfrom,aa.region,CONVERT(VARCHAR(10),GETDATE(),111) bdate,bb.BindMoney,bb.Money,
 bb.BindMoney-aa.BindMoney yesBindMoney,bb.Money-aa.Money yesMoney from (
 SELECT a.platfrom,b.realregion region,SUM(BindMoney) BindMoney,SUM(Money) Money FROM  mieshen_every (NOLOCK) a,dbo.region_real b
  WHERE a.platfrom=b.platform AND a.region=b.region  AND a.bdate=CONVERT(VARCHAR(10),DATEADD(DAY,-1,GETDATE()),111)
  GROUP BY a.platfrom,b.realregion) aa,
  (
 SELECT a.platfrom,b.realregion region,SUM(ISNULL(a.BindMoney,0)) BindMoney,sum(ISNULL(a.Money,0)) Money FROM dbo.mieshen_info (NOLOCK) a,dbo.region_real b
  WHERE a.platfrom=b.platform AND a.region=b.region AND a.gamename=b.gamename
  GROUP BY a.platfrom,b.realregion) bb where aa.platfrom=bb.platfrom
  and aa.region=bb.region) ss where 
  ";
                }
                else
                {
                    strwhere += $" and ss.bdate='" + Convert.ToDateTime(model.Bdate).ToString("yyyy-MM-dd") + "'";
                }
            }

            if (model.Region != null && model.Region != "")
            {
                strwhere += $" and ss.region in (select realregion from region_real where region=" + model.Region + ")";
            }
            if (model.Platform != null && model.Platform != "")
            {
                strwhere += $" and ss.platfrom='" + model.Platform + "'";
            }
            model.Sql = model.Sql + strwhere;
            var result = await CommonRespository.GetQueryResult(_SqlDB, model);

            return(Json(result));
        }