Przeglądaj źródła

辅助工具加上联动相关的判断
去掉机具补录重置交易额

lcl 3 lat temu
rodzic
commit
2611b03e3a

+ 8 - 14
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -187,9 +187,12 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
                 }
+                else if (pos.BrandId == 10 || pos.BrandId == 11)
+                {
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
+                }
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
-                StatTradeAmount(pos.PosSn, StartId);
             }
             if (AddActPrize == 1)
             {
@@ -470,10 +473,13 @@ namespace MySystem.Areas.Admin.Controllers
                 else if (pos.BrandId == 9)
                 {
                     CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
+                }                
+                else if (pos.BrandId == 10 || pos.BrandId == 11)
+                {
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
                 }
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
-                StatTradeAmount(pos.PosSn);
             }
             if (AddActPrize == 1)
             {
@@ -798,18 +804,6 @@ namespace MySystem.Areas.Admin.Controllers
             }
             db.Dispose();
         }
-        //重置交易额
-        public void StatTradeAmount(string PosSn, int StartId = 0)
-        {
-            DateTime start = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
-            if (DateTime.Now.Day == 1)
-            {
-                start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
-            }
-            DateTime end = DateTime.Now;
-            SycnSpTradeService.Instance.Start(PosSn, start, end, StartId);
-            RedisDbconn.Instance.AddList("ResetTradeAmountList", PosSn);
-        }
 
         #endregion