|
@@ -1777,19 +1777,45 @@ namespace MySystem
|
|
|
{
|
|
|
CustomerSqlConn.op("update Users set ThisMonthTrade=0 where ThisMonthTrade>0", MysqlConn.SqlConnStr);
|
|
|
}
|
|
|
+ string sql = "";
|
|
|
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);
|
|
|
+ int index = 0;
|
|
|
foreach (DataRow dr in list.Rows)
|
|
|
{
|
|
|
+ index += 1;
|
|
|
string UserId = dr["UserId"].ToString();
|
|
|
string ThisMonthTrade = dr[1].ToString();
|
|
|
- CustomerSqlConn.op("update Users set ThisMonthTrade=" + ThisMonthTrade + " where Id=" + UserId, MysqlConn.SqlConnStr);
|
|
|
+ sql += "update Users set ThisMonthTrade=" + ThisMonthTrade + " where Id=" + UserId + ";";
|
|
|
+ if(index >= 200)
|
|
|
+ {
|
|
|
+ CustomerSqlConn.op(sql, MysqlConn.SqlConnStr);
|
|
|
+ sql = "";
|
|
|
+ index = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!string.IsNullOrEmpty(sql))
|
|
|
+ {
|
|
|
+ CustomerSqlConn.op(sql, MysqlConn.SqlConnStr);
|
|
|
}
|
|
|
+ sql = "";
|
|
|
+ index = 0;
|
|
|
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)
|
|
|
{
|
|
|
+ index += 1;
|
|
|
string UserId = dr["UserId"].ToString();
|
|
|
string ThisMonthTrade = dr[1].ToString();
|
|
|
- CustomerSqlConn.op("update Users set ThisMonthTrade=ThisMonthTrade+" + ThisMonthTrade + " where Id=" + UserId, MysqlConn.SqlConnStr);
|
|
|
+ sql += "update Users set ThisMonthTrade=ThisMonthTrade+" + ThisMonthTrade + " where Id=" + UserId + ";";
|
|
|
+ if(index >= 200)
|
|
|
+ {
|
|
|
+ CustomerSqlConn.op(sql, MysqlConn.SqlConnStr);
|
|
|
+ sql = "";
|
|
|
+ index = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!string.IsNullOrEmpty(sql))
|
|
|
+ {
|
|
|
+ CustomerSqlConn.op(sql, MysqlConn.SqlConnStr);
|
|
|
}
|
|
|
// Thread th = new Thread(StatTradeAmountEverDay);
|
|
|
// th.IsBackground = true;
|