|
|
@@ -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
|