浏览代码

乐刷海科交易额,每天递减

lcl 1 年之前
父节点
当前提交
f659b05baf
共有 1 个文件被更改,包括 41 次插入1 次删除
  1. 41 1
      AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

+ 41 - 1
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -402,6 +402,11 @@ namespace MySystem
                                             {
                                                 HelpProfitFlag = "HelpProfit";
                                             }
+                                            int ActStatus = pos.ActivationState;
+                                            if(BrandId == 4 || BrandId == 5 || BrandId == 8 || BrandId == 9)
+                                            {
+                                                ActStatus = GetLeShuaHaiKe(pos.UserId, BrandId);
+                                            }
                                             db.TradeRecord.Add(new PxcModels.TradeRecord()
                                             {
                                                 ParentNav = user.ParentNav,
@@ -428,7 +433,7 @@ namespace MySystem
                                                 MerUserId = pos.UserId, //商户直属创客
                                                 SeoTitle = HelpProfitFlag,
                                                 Version = MerHelpFlag == 2 ? 1 : 0,
-                                                ActStatus = pos.ActivationState,
+                                                ActStatus = ActStatus,
                                             });
                                         }
                                         // 立刷60天内刷满10000,再返40
@@ -489,5 +494,40 @@ namespace MySystem
                 Thread.Sleep(1000);
             }
         }
+
+        private int GetLeShuaHaiKe(int UserId, int BrandId)
+        {
+            if(DateTime.Now >= DateTime.Parse("2023-08-01 00:00:00"))
+            {
+                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)
+            {
+                check += 1;
+                RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, check.ToString());
+            }
+            else
+            {
+                ActStatus = -1;
+                RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, "0");
+            }
+            return ActStatus;
+        }
     }
 }