Explorar o código

创客月费逻辑调整

lichunlei %!s(int64=2) %!d(string=hai) anos
pai
achega
fb936c20b5
Modificáronse 2 ficheiros con 8 adicións e 3 borrados
  1. 4 1
      AppStart/UserMonthFeeHelper.cs
  2. 4 2
      Startup.cs

+ 4 - 1
AppStart/UserMonthFeeHelper.cs

@@ -35,13 +35,16 @@ public class UserMonthFeeHelper
                     DoSomething(db, int.Parse(content));
                     db.Dispose();
                 }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
             }
             catch (Exception ex)
             {
                 function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "创客每月月费扣款异常");
             }
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "创客每月月费扣款日志");
-            Thread.Sleep(60000);
         }
     }
 

+ 4 - 2
Startup.cs

@@ -105,12 +105,13 @@ namespace MySystem
             MySystemLib.SystemPublicFuction.appid = appid;
             MySystemLib.SystemPublicFuction.checkurl = checkurl;
             MySystemLib.SystemPublicFuction.appcheck = "success";
+            string conn = Configuration["Setting:SqlConnStr"];
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
-            System.Data.DataTable tablecollection = Library.dbconn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'");
+            System.Data.DataTable tablecollection = Library.CustomerSqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'", conn);
             foreach (System.Data.DataRow subtable in tablecollection.Rows)
             {
                 Dictionary<string, string> Columns = new Dictionary<string, string>();
-                System.Data.DataTable columncollection = Library.dbconn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                System.Data.DataTable columncollection = Library.CustomerSqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'", conn);
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();
@@ -140,6 +141,7 @@ namespace MySystem
                 app.UseExceptionHandler("/Home/Error");
                 app.UseHsts();
             }
+            Library.ConfigurationManager.EnvironmentFlag = 2;
             Library.function.WritePage("/", "WebRootPath.txt", env.WebRootPath);
             // app.UseStatusCodePagesWithReExecute("/public/errpage/pc/{0}.html");