Преглед изворни кода

盟主兑换机具券,盟主标记问题
购买券,返购机奖励,备注判断

lcl пре 1 година
родитељ
комит
a2b1ea8de8

+ 6 - 3
AppStart/Helper/LeaderApplyCouponsHelper.cs

@@ -36,6 +36,8 @@ namespace MySystem
                         WebCMSEntities db = new WebCMSEntities();
                         var queryList = db.LeaderReserveRecord.FirstOrDefault(m => m.Id == Id) ?? new LeaderReserveRecord();
 
+                        List<int> couponIds = new List<int>();
+
                         JsonData ApplyList = JsonMapper.ToObject(queryList.SeoTitle);
                         for (int i = 0; i < ApplyList.Count; i++)
                         {
@@ -55,6 +57,7 @@ namespace MySystem
                                         QueryCount = Id,
                                         SnNo = posCoupon.ExchangeCode,
                                     });
+                                    couponIds.Add(item.Id);
                                 }
                             }
                             //大机
@@ -71,13 +74,14 @@ namespace MySystem
                                         QueryCount = Id,
                                         SnNo = posCoupon.ExchangeCode,
                                     });
+                                    couponIds.Add(items.Id);
                                 }
                             }
                             db.SaveChanges();
                         }
                         db.SaveChanges();
                         
-                        dosomething(Id);
+                        dosomething(Id, couponIds);
                     }
                     catch (Exception ex)
                     {
@@ -91,7 +95,7 @@ namespace MySystem
             }
         }
 
-        public void dosomething(int Id)
+        public void dosomething(int Id, List<int> couponIds)
         { 
             WebCMSEntities db = new WebCMSEntities();
             OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
@@ -127,7 +131,6 @@ namespace MySystem
                             {
                                 Step = 2;
                             }
-                            List<int> couponIds = db.PosCoupons.Where(m => m.IsLock == 0 && m.IsUse == 0 && m.UserId == query.UserId && m.QueryCount == Kind).OrderBy(m => m.Id).Take(num).ToList().Select(m => m.Id).ToList();
                             int result = PosCouponPrizeService.Instance.SetPosCouponLeaderFlag(db, parentUser.Id, num / Step, couponIds);
                             if(result > 0) BigLeaderFlag = true;
                         }

+ 16 - 2
AppStart/Helper/PosCouponPrize/PosCouponPrizeService.cs

@@ -122,7 +122,16 @@ namespace MySystem
                                 decimal GetPrize = CurBuyPrize - BuyPrize;
                                 if(GetPrize > 0) 
                                 {
-                                    OpAccount(db, order.Id, parentUser.Id, CurBuyPrize - BuyPrize, order.BuyCount, 118);
+                                    int ChangeType = 118;
+                                    if(parentUser.OperateLevel == 1)
+                                    {
+                                        ChangeType = 120;
+                                    }
+                                    if(parentUser.OperateLevel > 1)
+                                    {
+                                        ChangeType = 128;
+                                    }
+                                    OpAccount(db, order.Id, parentUser.Id, CurBuyPrize - BuyPrize, order.BuyCount, ChangeType);
                                     BuyPrize = CurBuyPrize;
                                 }
                             }
@@ -155,7 +164,12 @@ namespace MySystem
                             decimal GetPrize = CurBuyPrize - BuyPrize;
                             if(GetPrize > 0)
                             {
-                                OpAccount(db, order.Id, parentUser.Id, GetPrize, order.BuyCount, 128);
+                                int ChangeType = 120;
+                                if(parentUser.OperateLevel > 1)
+                                {
+                                    ChangeType = 128;
+                                }
+                                OpAccount(db, order.Id, parentUser.Id, GetPrize, order.BuyCount, ChangeType);
                                 BuyPrize = CurBuyPrize;
                             }