Browse Source

扣服务费逻辑顺序变更

lcl 3 years ago
parent
commit
346d6558c8
1 changed files with 4 additions and 4 deletions
  1. 4 4
      AppStart/Helper/SycnProfitServiceV3.cs

+ 4 - 4
AppStart/Helper/SycnProfitServiceV3.cs

@@ -272,14 +272,14 @@ namespace MySystem
             CustomerSqlConn.op("update UserAccount a set BalanceAmount=BalanceAmount+(select ProfitRate from UserProfit where Id=a.Id),TotalAmount=TotalAmount+(select ProfitRate from UserProfit where Id=a.Id) where Id in (select Id from UserProfit)", conn);
 
             string Month = DateTime.Now.AddDays(-90).ToString("yyyy-MM");
-            
-            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,BalanceAmount,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-BalanceAmount AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>0 and BalanceAmount<10", conn);
-
-            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,10,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-10 AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>=10;", conn);
 
             CustomerSqlConn.op("update UserAccount a set BalanceAmount=0 where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>0 and BalanceAmount<10", conn);
 
             CustomerSqlConn.op("update UserAccount a set BalanceAmount=BalanceAmount-10 where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>=10", conn);
+            
+            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,BalanceAmount,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-BalanceAmount AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>0 and BalanceAmount<10", conn);
+
+            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,10,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-10 AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>=10;", conn);
         }
 
         #endregion