瀏覽代碼

修复小分仓额度重置问题

lcl 2 年之前
父節點
當前提交
5f100e2ad9
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      AppStart/Timer/ResetSmallStoreHelper.cs

+ 3 - 3
AppStart/Timer/ResetSmallStoreHelper.cs

@@ -43,7 +43,7 @@ public class ResetSmallStoreHelper
                         function.WritePage("/ResetSmallStore/", Month + ".txt", DateTime.Now.ToString());
                         CustomerSqlConn.op("update UserAccount set ThisMonthPreAmount=0,ValidPreAmount=0 where ThisMonthPreAmount>0", connstr);
                         string minId = "0";
-                        DataTable minIdDt = CustomerSqlConn.dtable("select min(Id) from ProfitRewardRecord where TradeMonth='" + PreMonth + "'", connstr);
+                        DataTable minIdDt = CustomerSqlConn.dtable("select min(Id) from ProfitRecord where SeoTitle='" + PreMonth + "'", connstr);
                         if(minIdDt.Rows.Count > 0)
                         {
                             minId = minIdDt.Rows[0][0].ToString();
@@ -99,11 +99,11 @@ public class ResetSmallStoreHelper
         string sql = "";
         if(string.IsNullOrEmpty(UId))
         {
-            sql = "select UserId,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord where Id>=" + minId + " and UserId>0 and TradeMonth='" + PreMonth + "' group by UserId";
+            sql = "select UserId,sum(ProfitAmount) from ProfitRecord where Id>=" + minId + " and UserId>0 and SeoTitle='" + PreMonth + "' group by UserId";
         }
         else
         {
-            sql = "select UserId,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord where UserId=" + UId + " and TradeMonth='" + PreMonth + "' group by UserId";
+            sql = "select UserId,sum(ProfitAmount) from ProfitRecord where Id>=" + minId + " and UserId=" + UId + " and SeoTitle='" + PreMonth + "' group by UserId";
         }
         string connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
         DataTable dt = CustomerSqlConn.dtable(sql, connstr);