|
@@ -53,13 +53,14 @@ namespace MySystem
|
|
|
while(check)
|
|
while(check)
|
|
|
{
|
|
{
|
|
|
string sql = "";
|
|
string sql = "";
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(TradeAmount),count(Id),SnNo from TradeRecord where Id>20000000 and ActStatus=1 and BrandId!=14 and UserId>0 and CreateDate>='" + date + " 00:00:00' and CreateDate<='" + date + " 23:59:59' group by UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),SnNo order by UserId limit " + pageNum + ",50", AppConfig.Base.TmpReadSqlConn);
|
|
|
|
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(TradeAmount),count(Id),SnNo,TradeDate from TradeRecord where Id>20000000 and ActStatus=1 and BrandId!=14 and UserId>0 and CreateDate>='" + date + " 00:00:00' and CreateDate<='" + date + " 23:59:59' group by UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),SnNo,TradeDate order by UserId limit " + pageNum + ",50", AppConfig.Base.TmpReadSqlConn);
|
|
|
if(dt.Rows.Count > 0)
|
|
if(dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
foreach (DataRow dr in dt.Rows)
|
|
foreach (DataRow dr in dt.Rows)
|
|
|
{
|
|
{
|
|
|
int UserId = int.Parse(dr["UserId"].ToString());
|
|
int UserId = int.Parse(dr["UserId"].ToString());
|
|
|
string SnNo = dr["SnNo"].ToString();
|
|
string SnNo = dr["SnNo"].ToString();
|
|
|
|
|
+ string BindingTime = dr["TradeDate"].ToString();
|
|
|
string ParentNav = dr["ParentNav"].ToString();
|
|
string ParentNav = dr["ParentNav"].ToString();
|
|
|
int BrandId = int.Parse(dr["BrandId"].ToString());
|
|
int BrandId = int.Parse(dr["BrandId"].ToString());
|
|
|
int BankCardType = int.Parse(dr["BankCardType"].ToString());
|
|
int BankCardType = int.Parse(dr["BankCardType"].ToString());
|
|
@@ -76,10 +77,6 @@ namespace MySystem
|
|
|
ParentNav += "," + UserId + ",";
|
|
ParentNav += "," + UserId + ",";
|
|
|
string[] UserIdList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
string[] UserIdList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
|
|
|
|
|
- WebCMSEntities db = new WebCMSEntities();
|
|
|
|
|
- PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == SnNo) ?? new PosMachinesTwo();
|
|
|
|
|
- db.Dispose();
|
|
|
|
|
-
|
|
|
|
|
if(Version < 2)
|
|
if(Version < 2)
|
|
|
{
|
|
{
|
|
|
//个人业绩
|
|
//个人业绩
|
|
@@ -141,7 +138,7 @@ namespace MySystem
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
sql += InsertOrUpdate("TradeDaySummary", "ProfitDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitDirectTradeAmt,HelpDirectTradeAmt,NotHelpDirectTradeAmt", ProfitDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitDirectTradeAmt + "," + HelpDirectTradeAmt + "," + NotHelpDirectTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
sql += InsertOrUpdate("TradeDaySummary", "ProfitDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitDirectTradeAmt,HelpDirectTradeAmt,NotHelpDirectTradeAmt", ProfitDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitDirectTradeAmt + "," + HelpDirectTradeAmt + "," + NotHelpDirectTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
|
- if (pos.BindingTime < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
|
|
|
|
+ if (DateTime.Parse(BindingTime) < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
{
|
|
{
|
|
|
sql += InsertOrUpdate("TradeDaySummaryBefore", "ProfitDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitDirectTradeAmt,HelpDirectTradeAmt,NotHelpDirectTradeAmt", ProfitDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitDirectTradeAmt + "," + HelpDirectTradeAmt + "," + NotHelpDirectTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
sql += InsertOrUpdate("TradeDaySummaryBefore", "ProfitDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitDirectTradeAmt,HelpDirectTradeAmt,NotHelpDirectTradeAmt", ProfitDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitDirectTradeAmt + "," + HelpDirectTradeAmt + "," + NotHelpDirectTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
|
}
|
|
}
|
|
@@ -211,7 +208,7 @@ namespace MySystem
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
sql += InsertOrUpdate("TradeDaySummary", "ProfitNonDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpNonDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpNonDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitNonDirectTradeAmt,HelpNonDirectTradeAmt,NotHelpNonDirectTradeAmt", ProfitNonDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpNonDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpNonDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitNonDirectTradeAmt + "," + HelpNonDirectTradeAmt + "," + NotHelpNonDirectTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
sql += InsertOrUpdate("TradeDaySummary", "ProfitNonDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpNonDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpNonDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitNonDirectTradeAmt,HelpNonDirectTradeAmt,NotHelpNonDirectTradeAmt", ProfitNonDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpNonDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpNonDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitNonDirectTradeAmt + "," + HelpNonDirectTradeAmt + "," + NotHelpNonDirectTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
|
- if (pos.BindingTime < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
|
|
|
|
+ if (DateTime.Parse(BindingTime) < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
{
|
|
{
|
|
|
sql += InsertOrUpdate("TradeDaySummaryBefore", "ProfitNonDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpNonDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpNonDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitNonDirectTradeAmt,HelpNonDirectTradeAmt,NotHelpNonDirectTradeAmt", ProfitNonDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpNonDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpNonDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitNonDirectTradeAmt + "," + HelpNonDirectTradeAmt + "," + NotHelpNonDirectTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
sql += InsertOrUpdate("TradeDaySummaryBefore", "ProfitNonDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum,HelpNonDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpNonDirectDebitTradeAmt,NotHelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapNum,ProfitNonDirectTradeAmt,HelpNonDirectTradeAmt,NotHelpNonDirectTradeAmt", ProfitNonDirectDebitTradeAmt + "," + ProfitDirectDebitCapTradeAmt + "," + ProfitDirectDebitCapNum + "," + HelpNonDirectDebitTradeAmt + "," + HelpDirectDebitCapTradeAmt + "," + HelpDirectDebitCapNum + "," + NotHelpNonDirectDebitTradeAmt + "," + NotHelpDirectDebitCapTradeAmt + "," + NotHelpDirectDebitCapNum + "," + ProfitNonDirectTradeAmt + "," + HelpNonDirectTradeAmt + "," + NotHelpNonDirectTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
|
}
|
|
}
|
|
@@ -247,7 +244,7 @@ namespace MySystem
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
sql += InsertOrUpdate("TradeDaySummary2", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
sql += InsertOrUpdate("TradeDaySummary2", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
|
- if (pos.BindingTime < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
|
|
|
|
+ if (DateTime.Parse(BindingTime) < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
{
|
|
{
|
|
|
sql += InsertOrUpdate("TradeDaySummary2Before", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
sql += InsertOrUpdate("TradeDaySummary2Before", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='self'");
|
|
|
}
|
|
}
|
|
@@ -258,7 +255,7 @@ namespace MySystem
|
|
|
foreach(string SubUserId in UserIdList)
|
|
foreach(string SubUserId in UserIdList)
|
|
|
{
|
|
{
|
|
|
sql += InsertOrUpdate("TradeDaySummary2", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
sql += InsertOrUpdate("TradeDaySummary2", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
|
- if (pos.BindingTime < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
|
|
|
|
+ if (DateTime.Parse(BindingTime) < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
{
|
|
{
|
|
|
sql += InsertOrUpdate("TradeDaySummary2Before", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
sql += InsertOrUpdate("TradeDaySummary2Before", "ProfitDebitTradeAmt,ProfitDebitCapTradeAmt,ProfitDebitCapNum,ProfitTradeAmt", ProfitDebitTradeAmt + "," + ProfitDebitCapTradeAmt + "," + ProfitDebitCapNum + "," + ProfitTradeAmt, "UserId=" + SubUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=" + BrandId + " and QueryCount=" + QrPayFlag + " and VipFlag=" + VipFlag + " and PayType=" + PayType + " and SeoTitle='team'");
|
|
|
}
|
|
}
|