Bläddra i källkod

每月扣创客10元服务费,排除商户型创客(无机具无推荐)

lcl 3 år sedan
förälder
incheckning
b475de2219
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4 4
      AppStart/Helper/SycnProfitServiceV3.cs

+ 4 - 4
AppStart/Helper/SycnProfitServiceV3.cs

@@ -273,13 +273,13 @@ namespace MySystem
 
             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 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,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 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 BalanceAmount>0 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 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);
         }
 
         #endregion