Browse Source

统计表同步数据限制Id

lichunlei 2 years ago
parent
commit
811f770b32
1 changed files with 6 additions and 1 deletions
  1. 6 1
      AppStart/Helper/ProfitService.cs

+ 6 - 1
AppStart/Helper/ProfitService.cs

@@ -266,9 +266,14 @@ namespace MySystem
         {
         {
             try
             try
             {
             {
+                string condition = "";
+                if(TableName == "PosMerchantTradeSummay") condition += " and Id<=14473274";
+                if(TableName == "UserTradeMonthSummary") condition += " and Id<=1132650";
+                if(TableName == "HelpProfitMerTradeSummay") condition += " and Id<=473971";
+                if(TableName == "RecommendTradeSummary") condition += " and Id<=236748";
                 string sql = "";
                 string sql = "";
                 int startId = int.Parse(function.CheckInt(function.ReadInstance("/TradeRecord/" + TableName + "Id.txt")));
                 int startId = int.Parse(function.CheckInt(function.ReadInstance("/TradeRecord/" + TableName + "Id.txt")));
-                DataTable dt = CustomerSqlConn.dtable("select * from " + TableName + " where Id>" + startId + " order by Id limit 100", AppConfig.Base.SqlConn);
+                DataTable dt = CustomerSqlConn.dtable("select * from " + TableName + " where Id>" + startId + condition + " order by Id limit 100", AppConfig.Base.SqlConn);
                 if(dt.Rows.Count > 0)
                 if(dt.Rows.Count > 0)
                 {
                 {
                     foreach(DataRow dr in dt.Rows)
                     foreach(DataRow dr in dt.Rows)