浏览代码

修复立刷免押50元奖励问题

lcl 1 年之前
父节点
当前提交
62dfef4950
共有 2 个文件被更改,包括 50 次插入11 次删除
  1. 50 6
      AppStart/Helper/StatService.cs
  2. 0 5
      AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

+ 50 - 6
AppStart/Helper/StatService.cs

@@ -89,6 +89,7 @@ namespace MySystem
                 {
                     function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理0押激活奖励");
                     activePrizeWithoutDeposit();
+                    activePrizeWithoutDeposit6();
                     function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理0押激活奖励");
                 }
                 catch (Exception ex)
@@ -381,7 +382,7 @@ namespace MySystem
             WebCMSEntities db = new WebCMSEntities();
             DateTime yesterday = DateTime.Now.AddDays(-1);
             DateTime today = DateTime.Now.AddMinutes(-10);
-            IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && string.IsNullOrEmpty(m.SeoKeyword) && m.BrandId != 12 && m.BrandId != 13 && m.Detail != "1");
+            IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && string.IsNullOrEmpty(m.SeoKeyword) && m.BrandId != 12 && m.BrandId != 13 && m.BrandId != 6 && m.Detail != "1");
             if (posid > 0)
             {
                 posList = posList.Where(m => m.Id == posid);
@@ -406,11 +407,7 @@ namespace MySystem
                         {
                             TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                         }
-                        // if(pos.BrandId == 6) //首台无押金机返50
-                        // {
-                        //     doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
-                        // }
-                        else if((pos.BrandId == 10 || pos.BrandId == 11) && DateTime.Now < DateTime.Parse("2023-05-01 00:00:00") && pos.IsFirst == 1) //首台无押金机返50
+                        if((pos.BrandId == 10 || pos.BrandId == 11) && DateTime.Now < DateTime.Parse("2023-05-01 00:00:00") && pos.IsFirst == 1) //首台无押金机返50
                         {
                             doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
                         }
@@ -431,6 +428,53 @@ namespace MySystem
             db.Dispose();
         }
 
+        public void activePrizeWithoutDeposit6(int posid = 0)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            DateTime yesterday = DateTime.Now.AddDays(-1);
+            DateTime today = DateTime.Now.AddMinutes(-10);
+            IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && m.CreditTrade >= 5000 && string.IsNullOrEmpty(m.SeoKeyword) && m.BrandId == 6 && m.Detail != "1");
+            if (posid > 0)
+            {
+                posList = posList.Where(m => m.Id == posid);
+            }
+            else
+            {
+                posList = posList.Where(m => m.ActivationTime >= yesterday && m.ActivationTime < today);
+            }
+            foreach (PosMachinesTwo pos in posList.ToList())
+            {
+                PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
+                if (merchant != null)
+                {
+                    string ParentNav = "";
+                    Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
+                    if (user != null)
+                    {
+                        int GetUserId = user.Id;
+                        ParentNav = user.ParentNav;
+                        int TopUserId = 0;
+                        if (!string.IsNullOrEmpty(ParentNav))
+                        {
+                            TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
+                        }
+                        // 立刷30天内刷满5000,无服务费机具,返50
+                        if (pos.BrandId == 6 && pos.BindingTime > DateTime.Now.AddDays(-30))
+                        {
+                            doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
+                        }
+                        PosMachinesTwo edit = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
+                        if(edit != null)
+                        {
+                            edit.Detail = "1";
+                            db.SaveChanges();
+                        }
+                    }
+                }
+            }
+            db.Dispose();
+        }
+
         public void activePrizeWithoutDeposit12(int posid = 0)
         {
             WebCMSEntities db = new WebCMSEntities();

+ 0 - 5
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -447,11 +447,6 @@ namespace MySystem
                                             string TradeDate = trade.CreateDate == null ? DateTime.Now.ToString("yyyyMMdd") : trade.CreateDate.Value.ToString("yyyyMMdd");
                                             RedisDbconn.Instance.AddList("StatMerTradeAmountQueue", "{\"TradeDate\":\"" + TradeDate + "\",\"TradeAmount\":\"" + TradeAmount + "\",\"MerchantId\":\"" + pos.BindMerchantId + "\",\"BrandId\":\"" + BrandId + "\"}");
                                         }
-                                        // 立刷30天内刷满5000,无服务费机具,返50
-                                        if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) == 0 && pos.CreditTrade >= 5000 && pos.ActivationState == 1 && pos.BindingTime > DateTime.Now.AddDays(-30))
-                                        {                                            
-                                            LiShuaActPrize(db, pos, 50);
-                                        }
                                         // 立刷60天内刷满10000,再返40
                                         if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) > 0&& pos.CreditTrade >= 10000 && pos.ActivationState == 1  && pos.BindingTime > DateTime.Now.AddDays(-60))
                                         {