|
@@ -35,7 +35,7 @@ namespace MySystem
|
|
|
if (string.IsNullOrEmpty(flag))
|
|
|
{
|
|
|
function.WritePage("/Stat/", doDate + ".txt", DateTime.Now.ToString("HH:mm:ss"));
|
|
|
- StartEverDay(doDate);
|
|
|
+ StartEverDay();
|
|
|
StatMerchantTrade(doDate);
|
|
|
}
|
|
|
}
|
|
@@ -1840,28 +1840,28 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
// 每天统计头一天的交易额
|
|
|
- public void StartEverDay(string date)
|
|
|
+ public void StartEverDay()
|
|
|
{
|
|
|
- string TradeMonth = DateTime.Now.ToString("yyyyMM");
|
|
|
+ string TradeMonth = DateTime.Now.AddMonths(-5).ToString("yyyyMM");
|
|
|
string PreMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
|
- if(DateTime.Now.Day == 1)
|
|
|
- {
|
|
|
- TradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
|
- PreMonth = DateTime.Now.AddMonths(-2).ToString("yyyyMM");
|
|
|
- }
|
|
|
- else if(DateTime.Now.Day == 2)
|
|
|
- {
|
|
|
- CustomerSqlConn.op("update Users set ThisMonthTrade=0 where ThisMonthTrade>0", MysqlConn.SqlConnStr);
|
|
|
- }
|
|
|
+ // if(DateTime.Now.Day == 1)
|
|
|
+ // {
|
|
|
+ // TradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
|
+ // PreMonth = DateTime.Now.AddMonths(-2).ToString("yyyyMM");
|
|
|
+ // }
|
|
|
+ // else if(DateTime.Now.Day == 2)
|
|
|
+ // {
|
|
|
+ // CustomerSqlConn.op("update Users set ThisMonthTrade=0 where ThisMonthTrade>0", MysqlConn.SqlConnStr);
|
|
|
+ // }
|
|
|
Dictionary<string, decimal> dic = new Dictionary<string, decimal>();
|
|
|
- DataTable list = CustomerSqlConn.dtable("select UserId,sum(HelpNonDirectTradeAmt+HelpNonDirectDebitTradeAmt+NotHelpNonDirectTradeAmt+NotHelpNonDirectDebitTradeAmt+ProfitNonDirectTradeAmt+ProfitNonDirectDebitTradeAmt) from TradeDaySummary where Id>=15055757 and TradeMonth='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
+ DataTable list = CustomerSqlConn.dtable("select UserId,sum(HelpNonDirectTradeAmt+HelpNonDirectDebitTradeAmt+NotHelpNonDirectTradeAmt+NotHelpNonDirectDebitTradeAmt+ProfitNonDirectTradeAmt+ProfitNonDirectDebitTradeAmt) from TradeDaySummary where Id>=15055757 and TradeMonth>='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|
|
|
string ThisMonthTrade = dr[1].ToString();
|
|
|
dic.Add(UserId, decimal.Parse(function.CheckNum(ThisMonthTrade)));
|
|
|
}
|
|
|
- list = CustomerSqlConn.dtable("select UserId,sum(ProfitTradeAmt+ProfitDebitTradeAmt) from TradeDaySummary2 where TradeMonth='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
+ list = CustomerSqlConn.dtable("select UserId,sum(ProfitTradeAmt+ProfitDebitTradeAmt) from TradeDaySummary2 where TradeMonth>='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|
|
@@ -1875,7 +1875,7 @@ namespace MySystem
|
|
|
dic.Add(UserId, decimal.Parse(function.CheckNum(ThisMonthTrade)));
|
|
|
}
|
|
|
}
|
|
|
- list = CustomerSqlConn.dtable("select UserId,sum(ActiveBuddyMerStatus)*10000 from UserTradeMonthSummary where TradeMonth='" + TradeMonth + "' and BrandId=14 and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
+ list = CustomerSqlConn.dtable("select UserId,sum(ActiveBuddyMerStatus)*10000 from UserTradeMonthSummary where TradeMonth>='" + TradeMonth + "' and BrandId=14 and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|
|
@@ -1889,7 +1889,7 @@ namespace MySystem
|
|
|
dic.Add(UserId, decimal.Parse(function.CheckNum(ThisMonthTrade)));
|
|
|
}
|
|
|
}
|
|
|
- list = CustomerSqlConn.dtable("select UserId,sum(TotalAmount) from UserAmountSummary where TradeMonth='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.MpSqlConnStr);
|
|
|
+ list = CustomerSqlConn.dtable("select UserId,sum(TotalAmount) from UserAmountSummary where TradeMonth>='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.MpSqlConnStr);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|
|
@@ -1903,7 +1903,7 @@ namespace MySystem
|
|
|
dic.Add(UserId, decimal.Parse(function.CheckNum(ThisMonthTrade)));
|
|
|
}
|
|
|
}
|
|
|
- list = CustomerSqlConn.dtable("select UserId,sum(TotalAmount) from UserAmountSummary where TradeMonth='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.MpSqlConnStr2);
|
|
|
+ list = CustomerSqlConn.dtable("select UserId,sum(TotalAmount) from UserAmountSummary where TradeMonth>='" + TradeMonth + "' and SeoTitle='team' and UserId>0 group by UserId", MysqlConn.MpSqlConnStr2);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|
|
@@ -1917,7 +1917,7 @@ namespace MySystem
|
|
|
dic.Add(UserId, decimal.Parse(function.CheckNum(ThisMonthTrade)));
|
|
|
}
|
|
|
}
|
|
|
- list = CustomerSqlConn.dtable("select UserId,SimValidActTeamCount*10000 from SimValidAct" + PreMonth + " where UserId>0", MysqlConn.StatSqlConnStr);
|
|
|
+ list = CustomerSqlConn.dtable("select UserId,SimValidActTeamCount*10000 from KxsStatServer.SimValidAct" + PreMonth + " where UserId>0", MysqlConn.ReadSqlConnStr);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|
|
@@ -1931,7 +1931,7 @@ namespace MySystem
|
|
|
dic.Add(UserId, decimal.Parse(function.CheckNum(ThisMonthTrade)));
|
|
|
}
|
|
|
}
|
|
|
- list = CustomerSqlConn.dtable("select UserId,sum(TradeAmount) from HelpProfitUserTradeSummay where UserId>0 and TradeMonth='" + TradeMonth + "' and SeoTitle='team' group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
+ list = CustomerSqlConn.dtable("select UserId,sum(TradeAmount) from HelpProfitUserTradeSummay where UserId>0 and TradeMonth>='" + TradeMonth + "' and SeoTitle='team' group by UserId", MysqlConn.ReadSqlConnStr);
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
string UserId = dr["UserId"].ToString();
|