lcl 11 months ago
parent
commit
abe6fe4d0b
1 changed files with 8 additions and 2 deletions
  1. 8 2
      AppStart/Helper/HyfAddPrizeService.cs

+ 8 - 2
AppStart/Helper/HyfAddPrizeService.cs

@@ -38,12 +38,12 @@ namespace MySystem
         public void DoSomething()
         {
             WebCMSEntities db = new WebCMSEntities();
-            DateTime online = DateTime.Parse("2024-07-04 00:00:00");
+            DateTime online = DateTime.Parse("2024-06-25 00:00:00");
             DateTime end = DateTime.Parse("2025-01-01 00:00:00");
             DateTime leftTime = DateTime.Now.AddDays(-30);
             DateTime rightTime = DateTime.Now.AddDays(-7);
             if(DateTime.Now > end) return;
-            IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.BindingState == 1 && m.ActivationState == 1 && m.CreditTrade >= 1000 && m.BindingTime >= online && m.BindingTime >= leftTime && m.BindingTime <= rightTime && (m.BrandId == 12 || m.BrandId == 13));
+            IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.BindingState == 1 && m.ActivationState == 1 && m.CreditTrade >= 1000 && m.BindingTime >= online && m.BindingTime >= leftTime && m.BindingTime <= rightTime && (m.BrandId == 12 || m.BrandId == 13) && m.Sort == 0);
             foreach (PosMachinesTwo pos in posList.ToList())
             {
                 function.WriteLog(str: "机具号:" + pos.PosSn, "盒力四射加码奖励日志");
@@ -53,6 +53,12 @@ namespace MySystem
                     function.WriteLog("机具所属人:" + user.Id, "盒力四射加码奖励日志");
                     int GetUserId = user.Id;
                     AlipayPayBack2Service.Instance.ChangeAccount(db, new Orders(), GetUserId, 50, 150);
+                    PosMachinesTwo edit = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
+                    if(edit != null)
+                    {
+                        edit.Sort = 1;
+                        db.SaveChanges();
+                    }
                 }
                 function.WriteLog("\n\n\n", "盒力四射加码奖励日志");
             }