Ver código fonte

购买券,返额度,先返盟主,再返合伙人

lcl 1 ano atrás
pai
commit
642e31cb57

+ 21 - 21
AppStart/Helper/PosCouponPrize/PosCouponPrizeService.cs

@@ -113,27 +113,7 @@ namespace MySystem
                                 DirectPrizeFlag = true;
                             }
                         }
-                        if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id))
-                        {
-                            //购机奖
-                            decimal CurBuyPrize = GetBuyPrize(parentUser);
-                            decimal GetPrize = CurBuyPrize - BuyPrize;
-                            if(GetPrize > 0)
-                            {
-                                OpAccount(db, order.Id, parentUser.Id, GetPrize, order.BuyCount, 128);
-                                BuyPrize = CurBuyPrize;
-                            }
-
-                            if(!BackAccountFlag)
-                            {
-                                BackAccountFlag = true;
-                                //扣减备用金
-                                OperateAmountChange(opdb, parentUser.Id, GetWithdrawMoney(parentUser) * order.BuyCount, 2, 1, "商城购机", true);
-                                //返回到余额
-                                OperateAmountChange(opdb, parentUser.Id, GetWithdrawMoney(parentUser) * order.BuyCount, 1, 2, "商城购机", true);
-                            }
-                        }
-                        else if(parentUser.AgoLeaderLevel > 0 && CheckLeaderReserve(db, order.BuyCount, parentUser.Id))
+                        if(parentUser.AgoLeaderLevel > 0 && CheckLeaderReserve(db, order.BuyCount, parentUser.Id))
                         {
                             //购机奖
                             if(parentUser.LeaderLevel > 0)
@@ -168,6 +148,26 @@ namespace MySystem
                                 }
                             }
                         }
+                        else if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id))
+                        {
+                            //购机奖
+                            decimal CurBuyPrize = GetBuyPrize(parentUser);
+                            decimal GetPrize = CurBuyPrize - BuyPrize;
+                            if(GetPrize > 0)
+                            {
+                                OpAccount(db, order.Id, parentUser.Id, GetPrize, order.BuyCount, 128);
+                                BuyPrize = CurBuyPrize;
+                            }
+
+                            if(!BackAccountFlag)
+                            {
+                                BackAccountFlag = true;
+                                //扣减备用金
+                                OperateAmountChange(opdb, parentUser.Id, GetWithdrawMoney(parentUser) * order.BuyCount, 2, 1, "商城购机", true);
+                                //返回到余额
+                                OperateAmountChange(opdb, parentUser.Id, GetWithdrawMoney(parentUser) * order.BuyCount, 1, 2, "商城购机", true);
+                            }
+                        }
                     }
                 }
             }

+ 8 - 5
Controllers/HomeController.cs

@@ -244,11 +244,14 @@ namespace MySystem.Controllers
             //         }
             //     }
             // }
-            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == "00003102702303069436067") ?? new PosMachinesTwo();
-            PosMerchantInfo check = db.PosMerchantInfo.FirstOrDefault(m => m.KqSnNo == "00003102702303069436067") ?? new PosMerchantInfo();
-            // int RecordId = PublicFunction.FeeSetRecord(db, pos, check, 0.63M);
-            string info = "{\"RecordId\":\"65931\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"2\",\"OpMan\": \""+"系统"+"\"}";
-            RedisDbconn.Instance.AddList("SetDepositQueue", info);
+            // PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == "00003102702303069436067") ?? new PosMachinesTwo();
+            // PosMerchantInfo check = db.PosMerchantInfo.FirstOrDefault(m => m.KqSnNo == "00003102702303069436067") ?? new PosMerchantInfo();
+            // // int RecordId = PublicFunction.FeeSetRecord(db, pos, check, 0.63M);
+            // string info = "{\"RecordId\":\"65931\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"2\",\"OpMan\": \""+"系统"+"\"}";
+            // RedisDbconn.Instance.AddList("SetDepositQueue", info);
+
+            StoreApplyHelper.Instance.DoSomething(db, 49690);
+
             db.Dispose();
 
             return result;