Browse Source

操作储备金增加按备注填充sort字段

lcl 1 year ago
parent
commit
03cada93fa
2 changed files with 18 additions and 4 deletions
  1. 14 0
      AppStart/Helper/AlipayPayBack2Service.cs
  2. 4 4
      Startup.cs

+ 14 - 0
AppStart/Helper/AlipayPayBack2Service.cs

@@ -837,6 +837,19 @@ namespace MySystem
         }
 
         //操作储备金
+        private int GetLeaderReserveRecordType(string Remark)
+        {
+            Dictionary<int, string> data = new Dictionary<int, string>();
+            data.Add(11, "兑换机具券,机具券兑换,系统增加(盟主储蓄金),系统扣减(盟主储蓄金),储备金购买");
+            data.Add(12, "系统增加(可提现余额),系统扣减(可提现余额)");
+            data.Add(13, "推荐大盟主,推荐小盟主,商城购机,购机奖励");
+            var item = data.FirstOrDefault(m => m.Value.Contains(Remark));
+            if(item.Key > 0)
+            {
+                return item.Key;
+            }
+            return 0;
+        }
         public void OpReserve(WebCMSEntities db, Orders order, int UserId, decimal Money, int ChangeType, int SourceUserId = 0, string Remark = "储备金购买")
         {
             UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
@@ -872,6 +885,7 @@ namespace MySystem
                 TradeMonth = DateTime.Now.ToString("yyyyMM"),
                 UserId = UserId,
                 SourceUserId = SourceUserId,
+                Sort = GetLeaderReserveRecordType(Remark),
             }).Entity;
             db.SaveChanges();
         }

+ 4 - 4
Startup.cs

@@ -272,10 +272,10 @@ namespace MySystem
         {
             string conn = Configuration["Setting:SqlConnStr"];
             string dbName = "KxsMainServer";
-            if(Library.ConfigurationManager.EnvironmentFlag == 2)
-            {
-                dbName = "KxsProfitServer";
-            }
+            // if(Library.ConfigurationManager.EnvironmentFlag == 2)
+            // {
+            //     dbName = "KxsProfitServer";
+            // }
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
             System.Data.DataTable tablecollection = Library.CustomerSqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = '" + dbName + "'", conn);
             foreach (System.Data.DataRow subtable in tablecollection.Rows)