Pārlūkot izejas kodu

修复展示激活奖励

lichunlei 3 gadi atpakaļ
vecāks
revīzija
51de9b9124

+ 6 - 3
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1065,11 +1065,14 @@ namespace MySystem.Areas.Admin.Controllers
                 Users user = db.Users.FirstOrDefault(m => m.Id == reward.UserId) ?? new Users();
                 DepositGet = "已领取";
                 DepositUser = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
-                var fAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 0);
-                var lAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 1);
-                if (fAmount != null && lAmount != null)
+                var fAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 0);                
+                if (fAmount != null)
                 {
                     headAmount = fAmount.RewardAmount;
+                }
+                var lAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 1);
+                if (lAmount != null)
+                {
                     footAmount = lAmount.RewardAmount;
                 }
             }

+ 2 - 2
Startup.cs

@@ -152,11 +152,11 @@ namespace MySystem
         {
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
             Library.OtherMySqlConn.connstr = Configuration["Setting:SqlConnStr"];
-            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer2'");
+            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'");
             foreach (System.Data.DataRow subtable in tablecollection.Rows)
             {
                 Dictionary<string, string> Columns = new Dictionary<string, string>();
-                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer2' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();