소스 검색

添加来客吧0押返50

lcl 2 년 전
부모
커밋
70dd3646ed
2개의 변경된 파일71개의 추가작업 그리고 3개의 파일을 삭제
  1. 70 3
      AppStart/Helper/StatService.cs
  2. 1 0
      Startup.cs

+ 70 - 3
AppStart/Helper/StatService.cs

@@ -89,7 +89,6 @@ namespace MySystem
                 {
                     function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理0押激活奖励");
                     activePrizeWithoutDeposit();
-                    // activePrizeWithoutDeposit6();
                     function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理0押激活奖励");
                 }
                 catch (Exception ex)
@@ -115,7 +114,6 @@ namespace MySystem
                 {
                     function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理盒易付0押激活奖励");
                     activePrizeWithoutDeposit12();
-                    // activePrizeWithoutDeposit122();
                     function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理盒易付0押激活奖励");
                 }
                 catch (Exception ex)
@@ -126,6 +124,31 @@ namespace MySystem
             }
         }
 
+        public void StartActiveReward15()
+        {
+            Thread th = new Thread(ActiveReward15);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void ActiveReward15()
+        {
+            while(true)
+            {
+                try
+                {
+                    function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理来客吧0押激活奖励");
+                    activePrizeWithoutDeposit15();
+                    function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理来客吧0押激活奖励");
+                }
+                catch (Exception ex)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "实时处理来客吧0押激活奖励异常");
+                }
+                Thread.Sleep(30000);
+            }
+        }
+
 
 
         //广电卡激活奖励
@@ -453,7 +476,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.BrandId != 6 && m.BrandId != 14 && 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.BrandId != 14 && m.BrandId != 15 && m.BrandId != 16 && m.Detail != "1");
             if (posid > 0)
             {
                 posList = posList.Where(m => m.Id == posid);
@@ -585,6 +608,50 @@ namespace MySystem
             db.Dispose();
         }
 
+        public void activePrizeWithoutDeposit15(int posid = 0)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            DateTime yesterday = DateTime.Now.AddDays(-30);
+            DateTime today = DateTime.Now.AddHours(-1);
+            IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && m.IsFirst == 1 && m.CreditTrade >= 5000 && string.IsNullOrEmpty(m.SeoKeyword) && (m.BrandId == 15 || m.BrandId == 16) && 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]);
+                        }
+                        //首台无押金机返50
+                        doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
+                        PosMachinesTwo item = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
+                        if(item != null)
+                        {
+                            item.Detail = "1";
+                            db.SaveChanges();
+                        }
+                    }
+                }
+            }
+            db.Dispose();
+        }
+
 
         public void activePrizeWithoutDeposit122(int posid = 0)
         {

+ 1 - 0
Startup.cs

@@ -179,6 +179,7 @@ namespace MySystem
                 StatService.Instance.StartActiveReward(); //实时处理激活奖励
                 StatService.Instance.StartActiveReward1(); //实时处理0押激活奖励
                 StatService.Instance.StartActiveReward2(); //实时处理盒易付0押激活奖励
+                StatService.Instance.StartActiveReward15(); //实时处理来客吧0押激活奖励
                 StatService.Instance.StartSimActive(); //实时广电卡激活奖励
                 StatService.Instance.StartOpenReward(); //实时获取开机奖励
                 LeaderPrizeService.Instance.Start(); //大盟主奖励发奖