瀏覽代碼

设置押金,来客吧电签需触发激活奖励发放标识

lcl 1 年之前
父節點
當前提交
2b0dddafa8
共有 1 個文件被更改,包括 21 次插入38 次删除
  1. 21 38
      AppStart/Helper/SycnSpServer/SycnSpActiveService.cs

+ 21 - 38
AppStart/Helper/SycnSpServer/SycnSpActiveService.cs

@@ -36,51 +36,34 @@ namespace MySystem
                     IQueryable<ActivateRecord> acts = spdb.ActivateRecord.Where(m => m.Id >= StartId && m.ActivateDate >= start && m.Status == 1).OrderByDescending(m => m.Id);
                     foreach (ActivateRecord act in acts.ToList())
                     {
-                        bool op = false;
-                        if (act.ActivateStatus == "00" && act.ProductType == "1")
+                        PxcModels.MachineForMerNo posFor = db.MachineForMerNo.FirstOrDefault(m => m.MerNo == act.MerNo) ?? new PxcModels.MachineForMerNo();
+                        PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
+                        if (pos != null)
                         {
-                            op = true;
-                        }
-                        else if (act.ProductType == "2" || act.ProductType == "4" || act.ProductType == "6" || act.ProductType == "7" || act.ProductType == "8" || act.ProductType == "9" || act.ProductType == "15")
-                        {
-                            op = true;
-                        }
-                        if (op)
-                        {
-                            PxcModels.MachineForMerNo posFor = db.MachineForMerNo.FirstOrDefault(m => m.MerNo == act.MerNo) ?? new PxcModels.MachineForMerNo();
-                            PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
-                            if (pos != null)
+                            PxcModels.KqProducts kqproduct = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new PxcModels.KqProducts();
+                            if (kqproduct.SingleDepositApi == 1)
                             {
-                                // pos.ActivationState = 1;
-                                // pos.ActivationTime = DateTime.Now;
-                                if (pos.BrandId == 2 || pos.BrandId == 4 || pos.BrandId == 5 || pos.BrandId == 6 || pos.BrandId == 7 || pos.BrandId == 8 || pos.BrandId == 9 || pos.BrandId == 15 || pos.BrandId == 16)
-                                {
-                                    pos.SeoKeyword = act.SeoTitle;
-                                    if(pos.BrandId == 15 || pos.BrandId == 16)
-                                    {
-                                        pos.Detail = "";
-                                    }
-                                    // pos.IsPurchase = 0;
-                                    db.SaveChanges();
-                                }
-
-                                ActivateRecord edit = spdb.ActivateRecord.FirstOrDefault(m => m.Id == act.Id);
-                                if (edit != null)
+                                pos.SeoKeyword = act.SeoTitle;
+                                if(pos.BrandId == 15 || pos.BrandId == 16) //来客吧
                                 {
-                                    edit.Status = 2;
+                                    pos.Detail = "";
                                 }
+                                db.SaveChanges();
+                            }
 
-                                // 激活奖励
-                                // ProfitHelper.Instance.StartListenActiveDo(pos);
+                            ActivateRecord edit = spdb.ActivateRecord.FirstOrDefault(m => m.Id == act.Id);
+                            if (edit != null)
+                            {
+                                edit.Status = 2;
                             }
-                            pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId && m.ActivationState == 1);
-                            if (pos != null)
+                        }
+                        pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId && m.ActivationState == 1);
+                        if (pos != null)
+                        {
+                            ActivateRecord edit = spdb.ActivateRecord.FirstOrDefault(m => m.Id == act.Id);
+                            if (edit != null)
                             {
-                                ActivateRecord edit = spdb.ActivateRecord.FirstOrDefault(m => m.Id == act.Id);
-                                if (edit != null)
-                                {
-                                    edit.Status = 2;
-                                }
+                                edit.Status = 2;
                             }
                         }
                     }