|
|
@@ -4818,7 +4818,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
|
- string condition = "";
|
|
|
+ string condition = " where 1=1";
|
|
|
var UserId = 0;
|
|
|
var bstart = "";
|
|
|
var bend = "";
|
|
|
@@ -4834,31 +4834,35 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string[] datelist = BindingTime.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
bstart = datelist[0] + " 00:00:00";
|
|
|
bend = datelist[1] + " 23:59:59";
|
|
|
+ condition += "and tb.BindingTime>='" + bstart + "' and tb.BindingTime<'" + bend + "'";
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(ActivationTime))
|
|
|
{
|
|
|
string[] datelist = ActivationTime.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
astart = datelist[0] + " 00:00:00";
|
|
|
aend = datelist[1] + " 23:59:59";
|
|
|
+ condition += " and tb.ActivationTime>='" + astart + "' and tb.ActivationTime<'" + aend + "'";
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(PosFee))
|
|
|
{
|
|
|
- condition += " and SeoKeyword=" + PosFee;
|
|
|
+ condition += " and tb.SeoKeyword=" + PosFee;
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(BrandId))
|
|
|
{
|
|
|
- condition += " and BrandId=" + BrandId;
|
|
|
+ condition += " and tb.BrandId=" + BrandId;
|
|
|
}
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BindingTime>='" + bstart + "' and BindingTime<'" + bend + "' and ActivationTime>='" + astart + "' and ActivationTime<'" + aend + "' and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id", conn);
|
|
|
+ var sql = "select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
|
|
|
+
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
|
|
|
foreach (DataRow item in dt.Rows)
|
|
|
{
|
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
- curData.Add("wname", item["TradeDate"]); //伙伴名称
|
|
|
- curData.Add("Name", item["TradeDate"]); //机具品牌
|
|
|
- curData.Add("PosSn", item["TradeDate"]); //机具Sn
|
|
|
- curData.Add("SeoKeyword", item["TradeDate"]); //押金
|
|
|
- curData.Add("BindingTime", item["TradeDate"]); //绑定时间
|
|
|
- curData.Add("ActivationTime", item["TradeDate"]); //激活时间
|
|
|
+ curData.Add("wname", item["wname"].ToString()); //伙伴名称
|
|
|
+ curData.Add("Name", item["Name"].ToString()); //机具品牌
|
|
|
+ curData.Add("PosSn", item["PosSn"].ToString()); //机具Sn
|
|
|
+ curData.Add("SeoKeyword", item["SeoKeyword"].ToString()); //押金
|
|
|
+ curData.Add("BindingTime", string.IsNullOrEmpty(item["BindingTime"].ToString()) ? "" : Convert.ToDateTime(item["BindingTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
|
|
|
+ curData.Add("ActivationTime", string.IsNullOrEmpty(item["ActivationTime"].ToString()) ? "" : Convert.ToDateTime(item["ActivationTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //激活时间
|
|
|
dataList.Add(curData);
|
|
|
}
|
|
|
Dictionary<string, object> obj = new Dictionary<string, object>();
|