Selaa lähdekoodia

乐刷海科交易额,每天递减,加异常捕捉

lcl 1 vuosi sitten
vanhempi
commit
5a45cc093d
1 muutettua tiedostoa jossa 28 lisäystä ja 21 poistoa
  1. 28 21
      AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

+ 28 - 21
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -502,30 +502,37 @@ namespace MySystem
                 return 0;
             }
             int ActStatus = 1;
-            string Date = DateTime.Now.ToString("yyyyMMdd");
-            int checkNum = 0;
-            if(Date == "20230720") checkNum = 12;
-            if(Date == "20230721") checkNum = 11;
-            if(Date == "20230722") checkNum = 10;
-            if(Date == "20230723") checkNum = 9;
-            if(Date == "20230724") checkNum = 8;
-            if(Date == "20230725") checkNum = 7;
-            if(Date == "20230726") checkNum = 6;
-            if(Date == "20230727") checkNum = 5;
-            if(Date == "20230728") checkNum = 4;
-            if(Date == "20230729") checkNum = 3;
-            if(Date == "20230730") checkNum = 2;
-            if(Date == "20230731") checkNum = 1;
-            int check = int.Parse(function.CheckInt(RedisDbconn.Instance.Get<string>("lscut:" + UserId + ":" + BrandId + ":" + Date)));
-            if(check <= checkNum)
+            try
             {
-                check += 1;
-                RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, check.ToString());
+                string Date = DateTime.Now.ToString("yyyyMMdd");
+                int checkNum = 0;
+                if(Date == "20230720") checkNum = 12;
+                if(Date == "20230721") checkNum = 11;
+                if(Date == "20230722") checkNum = 10;
+                if(Date == "20230723") checkNum = 9;
+                if(Date == "20230724") checkNum = 8;
+                if(Date == "20230725") checkNum = 7;
+                if(Date == "20230726") checkNum = 6;
+                if(Date == "20230727") checkNum = 5;
+                if(Date == "20230728") checkNum = 4;
+                if(Date == "20230729") checkNum = 3;
+                if(Date == "20230730") checkNum = 2;
+                if(Date == "20230731") checkNum = 1;
+                int check = int.Parse(function.CheckInt(RedisDbconn.Instance.Get<string>("lscut:" + UserId + ":" + BrandId + ":" + Date)));
+                if(check <= checkNum)
+                {
+                    check += 1;
+                    RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, check.ToString());
+                }
+                else
+                {
+                    ActStatus = -1;
+                    RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, "0");
+                }
             }
-            else
+            catch(Exception ex)
             {
-                ActStatus = -1;
-                RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, "0");
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "乐刷海科计数异常");
             }
             return ActStatus;
         }