|
|
@@ -31,11 +31,11 @@ namespace MySystem
|
|
|
{
|
|
|
while (true)
|
|
|
{
|
|
|
- if(RedisDbconn.Instance.Get<string>("StatServerStatus") == "1" && DateTime.Now.Hour >= 3)
|
|
|
+ if (RedisDbconn.Instance.Get<string>("StatServerStatus") == "1" && DateTime.Now.Hour >= 3)
|
|
|
{
|
|
|
StatTrade();
|
|
|
}
|
|
|
- Thread.Sleep(30000);
|
|
|
+ Thread.Sleep(300);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -48,23 +48,23 @@ namespace MySystem
|
|
|
try
|
|
|
{
|
|
|
string startId = function.ReadInstance("/TradeRecord/Id4.txt");
|
|
|
- if(string.IsNullOrEmpty(startId))
|
|
|
+ if (string.IsNullOrEmpty(startId))
|
|
|
{
|
|
|
startId = "19613145";
|
|
|
}
|
|
|
- string sql = "select Id from TradeRecord where Id>=" + startId + " and CreateDate>='2024-01-01 00:00:00' and DirectFlag=0 and ActStatus=1 and BrandId!=14 order by Id limit 50";
|
|
|
- if(Id > 0)
|
|
|
+ string sql = "select Id from TradeRecord where Id>=" + startId + " and CreateDate>='2024-01-01 00:00:00' and DirectFlag=0 and ActStatus=1 and BrandId!=14 order by Id limit 500";
|
|
|
+ if (Id > 0)
|
|
|
{
|
|
|
sql = "select Id from TradeRecord where Id=" + Id;
|
|
|
}
|
|
|
DataTable idsDt = CustomerSqlConn.dtable(sql, AppConfig.Base.SqlConn);
|
|
|
- if(idsDt.Rows.Count > 0)
|
|
|
+ if (idsDt.Rows.Count > 0)
|
|
|
{
|
|
|
string ids = "";
|
|
|
foreach (DataRow idsDr in idsDt.Rows)
|
|
|
{
|
|
|
ids += idsDr["Id"].ToString() + ",";
|
|
|
- if(Id == 0)
|
|
|
+ if (Id == 0)
|
|
|
{
|
|
|
startId = idsDr["Id"].ToString();
|
|
|
}
|
|
|
@@ -76,15 +76,15 @@ namespace MySystem
|
|
|
foreach (DataRow selfDr in selfDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(selfDr["UserId"].ToString());
|
|
|
- string SnNo = selfDr["SnNo"].ToString();
|
|
|
+ string SnNo = selfDr["SnNo"].ToString();
|
|
|
PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == SnNo) ?? new PosMachinesTwo();
|
|
|
- if(UserId == 0)
|
|
|
+ if (UserId == 0)
|
|
|
{
|
|
|
UserId = pos.UserId;
|
|
|
}
|
|
|
Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
string ParentNav = user.ParentNav; //selfDr["ParentNav"].ToString();
|
|
|
- if(pos.BindingTime < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
+ if (pos.BindingTime < DateTime.Parse("2023-07-01 00:00:00"))
|
|
|
{
|
|
|
StatBefore(db, selfDr, UserId, ParentNav);
|
|
|
}
|
|
|
@@ -94,7 +94,7 @@ namespace MySystem
|
|
|
}
|
|
|
}
|
|
|
CustomerSqlConn.op("update TradeRecord set DirectFlag=1 where Id in (" + ids.TrimEnd(',') + ")", AppConfig.Base.SqlConn);
|
|
|
- if(Id == 0)
|
|
|
+ if (Id == 0)
|
|
|
{
|
|
|
function.WritePage("/TradeRecord/", "Id4.txt", startId);
|
|
|
}
|
|
|
@@ -128,214 +128,218 @@ namespace MySystem
|
|
|
int TradeCount = int.Parse(selfDr[12].ToString());
|
|
|
string TradeMonth = TradeDate.Substring(0, 6);
|
|
|
|
|
|
- TradeDaySummaryBefore selfStat = db.TradeDaySummaryBefore.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
- if (selfStat == null)
|
|
|
+ if (Version < 2)
|
|
|
{
|
|
|
- selfStat = db.TradeDaySummaryBefore.Add(new TradeDaySummaryBefore()
|
|
|
+ TradeDaySummaryBefore selfStat = db.TradeDaySummaryBefore.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
+ if (selfStat == null)
|
|
|
{
|
|
|
- UserId = UserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "self",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- if (BankCardType == 0)
|
|
|
- {
|
|
|
- if (Version == 1)
|
|
|
- {
|
|
|
- selfStat.ProfitDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ selfStat = db.TradeDaySummaryBefore.Add(new TradeDaySummaryBefore()
|
|
|
{
|
|
|
- selfStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
- }
|
|
|
+ UserId = UserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "self",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- selfStat.HelpDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 1)
|
|
|
{
|
|
|
- selfStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ selfStat.ProfitDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selfStat.NotHelpDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
{
|
|
|
- selfStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ selfStat.HelpDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selfStat.NotHelpDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 1)
|
|
|
- {
|
|
|
- selfStat.ProfitDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
- {
|
|
|
- selfStat.HelpDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selfStat.NotHelpDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- }
|
|
|
- ParentNav += "," + UserId + ",";
|
|
|
- if (!string.IsNullOrEmpty(ParentNav))
|
|
|
- {
|
|
|
- string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
- foreach (string NavUserIdString in ParentNavList)
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- int NavUserId = int.Parse(NavUserIdString);
|
|
|
- TradeDaySummaryBefore teamStat = db.TradeDaySummaryBefore.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
- if (teamStat == null)
|
|
|
+ if (Version == 1)
|
|
|
{
|
|
|
- teamStat = db.TradeDaySummaryBefore.Add(new TradeDaySummaryBefore()
|
|
|
- {
|
|
|
- UserId = NavUserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "team",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
+ selfStat.ProfitDirectTradeAmt += TradeAmount;
|
|
|
}
|
|
|
- if (BankCardType == 0)
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.HelpDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selfStat.NotHelpDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ParentNav += "," + UserId + ",";
|
|
|
+ if (!string.IsNullOrEmpty(ParentNav))
|
|
|
+ {
|
|
|
+ string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
+ foreach (string NavUserIdString in ParentNavList)
|
|
|
{
|
|
|
- if (Version == 1)
|
|
|
+ int NavUserId = int.Parse(NavUserIdString);
|
|
|
+ TradeDaySummaryBefore teamStat = db.TradeDaySummaryBefore.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
+ if (teamStat == null)
|
|
|
{
|
|
|
- teamStat.ProfitNonDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ teamStat = db.TradeDaySummaryBefore.Add(new TradeDaySummaryBefore()
|
|
|
{
|
|
|
- teamStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
- }
|
|
|
+ UserId = NavUserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "team",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- teamStat.HelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 1)
|
|
|
{
|
|
|
- teamStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ teamStat.ProfitNonDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- teamStat.NotHelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
{
|
|
|
- teamStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ teamStat.HelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ teamStat.NotHelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 1)
|
|
|
- {
|
|
|
- teamStat.ProfitNonDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
- {
|
|
|
- teamStat.HelpNonDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- teamStat.NotHelpNonDirectTradeAmt += TradeAmount;
|
|
|
+ if (Version == 1)
|
|
|
+ {
|
|
|
+ teamStat.ProfitNonDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.HelpNonDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ teamStat.NotHelpNonDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //盈利期,费率0.6
|
|
|
- TradeDaySummary2Before selfStat2 = db.TradeDaySummary2Before.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
- if (selfStat2 == null)
|
|
|
+ else
|
|
|
{
|
|
|
- selfStat2 = db.TradeDaySummary2Before.Add(new TradeDaySummary2Before()
|
|
|
+ //盈利期,费率0.6
|
|
|
+ TradeDaySummary2Before selfStat2 = db.TradeDaySummary2Before.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
+ if (selfStat2 == null)
|
|
|
{
|
|
|
- UserId = UserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "self",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- if (BankCardType == 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ selfStat2 = db.TradeDaySummary2Before.Add(new TradeDaySummary2Before()
|
|
|
+ {
|
|
|
+ UserId = UserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "self",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- selfStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 2)
|
|
|
{
|
|
|
- selfStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ selfStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- selfStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ if (Version == 2)
|
|
|
+ {
|
|
|
+ selfStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(ParentNav))
|
|
|
- {
|
|
|
- string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
- foreach (string NavUserIdString in ParentNavList)
|
|
|
+ if (!string.IsNullOrEmpty(ParentNav))
|
|
|
{
|
|
|
- int NavUserId = int.Parse(NavUserIdString);
|
|
|
- TradeDaySummary2Before teamStat2 = db.TradeDaySummary2Before.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
- if (teamStat2 == null)
|
|
|
+ string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
+ foreach (string NavUserIdString in ParentNavList)
|
|
|
{
|
|
|
- teamStat2 = db.TradeDaySummary2Before.Add(new TradeDaySummary2Before()
|
|
|
+ int NavUserId = int.Parse(NavUserIdString);
|
|
|
+ TradeDaySummary2Before teamStat2 = db.TradeDaySummary2Before.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
+ if (teamStat2 == null)
|
|
|
{
|
|
|
- UserId = NavUserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "team",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- if (BankCardType == 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ teamStat2 = db.TradeDaySummary2Before.Add(new TradeDaySummary2Before()
|
|
|
+ {
|
|
|
+ UserId = NavUserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "team",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- teamStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 2)
|
|
|
{
|
|
|
- teamStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ teamStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- teamStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ if (Version == 2)
|
|
|
+ {
|
|
|
+ teamStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -356,215 +360,218 @@ namespace MySystem
|
|
|
decimal TradeAmount = decimal.Parse(selfDr[11].ToString());
|
|
|
int TradeCount = int.Parse(selfDr[12].ToString());
|
|
|
string TradeMonth = TradeDate.Substring(0, 6);
|
|
|
-
|
|
|
- TradeDaySummaryAfter selfStat = db.TradeDaySummaryAfter.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
- if (selfStat == null)
|
|
|
+ if (Version < 2)
|
|
|
{
|
|
|
- selfStat = db.TradeDaySummaryAfter.Add(new TradeDaySummaryAfter()
|
|
|
+ TradeDaySummaryAfter selfStat = db.TradeDaySummaryAfter.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
+ if (selfStat == null)
|
|
|
{
|
|
|
- UserId = UserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "self",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- if (BankCardType == 0)
|
|
|
- {
|
|
|
- if (Version == 1)
|
|
|
- {
|
|
|
- selfStat.ProfitDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ selfStat = db.TradeDaySummaryAfter.Add(new TradeDaySummaryAfter()
|
|
|
{
|
|
|
- selfStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
- }
|
|
|
+ UserId = UserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "self",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- selfStat.HelpDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 1)
|
|
|
{
|
|
|
- selfStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ selfStat.ProfitDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selfStat.NotHelpDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
{
|
|
|
- selfStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ selfStat.HelpDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selfStat.NotHelpDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 1)
|
|
|
- {
|
|
|
- selfStat.ProfitDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
- {
|
|
|
- selfStat.HelpDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selfStat.NotHelpDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- }
|
|
|
- ParentNav += "," + UserId + ",";
|
|
|
- if (!string.IsNullOrEmpty(ParentNav))
|
|
|
- {
|
|
|
- string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
- foreach (string NavUserIdString in ParentNavList)
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- int NavUserId = int.Parse(NavUserIdString);
|
|
|
- TradeDaySummaryAfter teamStat = db.TradeDaySummaryAfter.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
- if (teamStat == null)
|
|
|
+ if (Version == 1)
|
|
|
{
|
|
|
- teamStat = db.TradeDaySummaryAfter.Add(new TradeDaySummaryAfter()
|
|
|
- {
|
|
|
- UserId = NavUserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "team",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
+ selfStat.ProfitDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat.HelpDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selfStat.NotHelpDirectTradeAmt += TradeAmount;
|
|
|
}
|
|
|
- if (BankCardType == 0)
|
|
|
+ }
|
|
|
+ ParentNav += "," + UserId + ",";
|
|
|
+ if (!string.IsNullOrEmpty(ParentNav))
|
|
|
+ {
|
|
|
+ string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
+ foreach (string NavUserIdString in ParentNavList)
|
|
|
{
|
|
|
- if (Version == 1)
|
|
|
+ int NavUserId = int.Parse(NavUserIdString);
|
|
|
+ TradeDaySummaryAfter teamStat = db.TradeDaySummaryAfter.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
+ if (teamStat == null)
|
|
|
{
|
|
|
- teamStat.ProfitNonDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ teamStat = db.TradeDaySummaryAfter.Add(new TradeDaySummaryAfter()
|
|
|
{
|
|
|
- teamStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
- }
|
|
|
+ UserId = NavUserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "team",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- teamStat.HelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 1)
|
|
|
{
|
|
|
- teamStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ teamStat.ProfitNonDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.ProfitDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat.ProfitDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- teamStat.NotHelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
{
|
|
|
- teamStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ teamStat.HelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.HelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat.HelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ teamStat.NotHelpNonDirectDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat.NotHelpDirectDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 1)
|
|
|
- {
|
|
|
- teamStat.ProfitNonDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else if (MerHelpFlag == 1)
|
|
|
- {
|
|
|
- teamStat.HelpNonDirectTradeAmt += TradeAmount;
|
|
|
- }
|
|
|
- else
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- teamStat.NotHelpNonDirectTradeAmt += TradeAmount;
|
|
|
+ if (Version == 1)
|
|
|
+ {
|
|
|
+ teamStat.ProfitNonDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else if (MerHelpFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat.HelpNonDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ teamStat.NotHelpNonDirectTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //盈利期,费率0.6
|
|
|
- TradeDaySummary2After selfStat2 = db.TradeDaySummary2After.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
- if (selfStat2 == null)
|
|
|
+ else
|
|
|
{
|
|
|
- selfStat2 = db.TradeDaySummary2After.Add(new TradeDaySummary2After()
|
|
|
+ //盈利期,费率0.6
|
|
|
+ TradeDaySummary2After selfStat2 = db.TradeDaySummary2After.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
|
|
|
+ if (selfStat2 == null)
|
|
|
{
|
|
|
- UserId = UserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "self",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- if (BankCardType == 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ selfStat2 = db.TradeDaySummary2After.Add(new TradeDaySummary2After()
|
|
|
+ {
|
|
|
+ UserId = UserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "self",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- selfStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 2)
|
|
|
{
|
|
|
- selfStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
- selfStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ selfStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ selfStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
+ selfStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- selfStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ if (Version == 2)
|
|
|
+ {
|
|
|
+ selfStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (!string.IsNullOrEmpty(ParentNav))
|
|
|
- {
|
|
|
- string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
- foreach (string NavUserIdString in ParentNavList)
|
|
|
+ if (!string.IsNullOrEmpty(ParentNav))
|
|
|
{
|
|
|
- int NavUserId = int.Parse(NavUserIdString);
|
|
|
- TradeDaySummary2After teamStat2 = db.TradeDaySummary2After.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
- if (teamStat2 == null)
|
|
|
+ string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
+ foreach (string NavUserIdString in ParentNavList)
|
|
|
{
|
|
|
- teamStat2 = db.TradeDaySummary2After.Add(new TradeDaySummary2After()
|
|
|
+ int NavUserId = int.Parse(NavUserIdString);
|
|
|
+ TradeDaySummary2After teamStat2 = db.TradeDaySummary2After.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
|
|
|
+ if (teamStat2 == null)
|
|
|
{
|
|
|
- UserId = NavUserId,
|
|
|
- TradeMonth = TradeMonth,
|
|
|
- TradeDate = TradeDate,
|
|
|
- BrandId = BrandId,
|
|
|
- QueryCount = QrPayFlag,
|
|
|
- VipFlag = VipFlag,
|
|
|
- PayType = PayType,
|
|
|
- SeoTitle = "team",
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- if (BankCardType == 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ teamStat2 = db.TradeDaySummary2After.Add(new TradeDaySummary2After()
|
|
|
+ {
|
|
|
+ UserId = NavUserId,
|
|
|
+ TradeMonth = TradeMonth,
|
|
|
+ TradeDate = TradeDate,
|
|
|
+ BrandId = BrandId,
|
|
|
+ QueryCount = QrPayFlag,
|
|
|
+ VipFlag = VipFlag,
|
|
|
+ PayType = PayType,
|
|
|
+ SeoTitle = "team",
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ if (BankCardType == 0)
|
|
|
{
|
|
|
- teamStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
- if (CapFlag == 1)
|
|
|
+ if (Version == 2)
|
|
|
{
|
|
|
- teamStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
- teamStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ teamStat2.ProfitDebitTradeAmt += TradeAmount;
|
|
|
+ if (CapFlag == 1)
|
|
|
+ {
|
|
|
+ teamStat2.ProfitDebitCapTradeAmt += TradeAmount;
|
|
|
+ teamStat2.ProfitDebitCapNum += TradeCount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else if (BankCardType != 0)
|
|
|
- {
|
|
|
- if (Version == 2)
|
|
|
+ else if (BankCardType != 0)
|
|
|
{
|
|
|
- teamStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ if (Version == 2)
|
|
|
+ {
|
|
|
+ teamStat2.ProfitTradeAmt += TradeAmount;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|