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

修复购买小盟主逻辑

lcl пре 1 година
родитељ
комит
93b28707f7
2 измењених фајлова са 28 додато и 20 уклоњено
  1. 26 18
      AppStart/Helper/AlipayPayBack2Service.cs
  2. 2 2
      Startup.cs

+ 26 - 18
AppStart/Helper/AlipayPayBack2Service.cs

@@ -341,7 +341,30 @@ namespace MySystem
                     decimal TotalPrice = 10000;
                     if((user.LeaderLevel == 2 || user.UserType == 1) && level > 1)
                     {
-                        if(user.LeaderLevel == 2 && result)
+                        if(user.UserType == 1 && result)
+                        {
+                            OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
+                            OpModels.UserAccount account = opdb.UserAccount.FirstOrDefault(m => m.Id == LeaderUserId) ?? new OpModels.UserAccount();
+                            if(account.TotalAmt > 0)
+                            {
+                                if(account.TotalAmt < TotalPrice)
+                                {
+                                    TotalPrice = account.TotalAmt;
+                                }
+                                if(TotalPrice > 0)
+                                {
+                                    OperateAmountChange(opdb, LeaderUserId, TotalPrice, 2, 1, "商城购机");
+                                    OperateAmountChange(opdb, LeaderUserId, TotalPrice, 1, 2, "商城购机");
+                                    LeaderUserId = 0;
+                                    result = false;
+                                }
+                            }
+                            else
+                            {
+                                LeaderUserId = user.ParentUserId;
+                            }
+                        }
+                        else if(user.LeaderLevel == 2 && result)
                         {
                             UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == LeaderUserId);
                             if(account != null)
@@ -362,24 +385,9 @@ namespace MySystem
                                 }
                             }
                         }
-                        if(user.UserType == 1 && result)
+                        else
                         {
-                            OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
-                            OpModels.UserAccount account = opdb.UserAccount.FirstOrDefault(m => m.Id == LeaderUserId) ?? new OpModels.UserAccount();
-                            if(account.TotalAmt > 0)
-                            {
-                                if(account.TotalAmt < TotalPrice)
-                                {
-                                    TotalPrice = account.TotalAmt;
-                                }
-                                if(TotalPrice > 0)
-                                {
-                                    OperateAmountChange(opdb, LeaderUserId, TotalPrice, 2, 1, "商城购机");
-                                    OperateAmountChange(opdb, LeaderUserId, TotalPrice, 1, 2, "商城购机");
-                                    LeaderUserId = 0;
-                                    result = false;
-                                }
-                            }
+                            LeaderUserId = user.ParentUserId;
                         }
                     }
                     else

+ 2 - 2
Startup.cs

@@ -163,8 +163,8 @@ namespace MySystem
             //必须打开的
             if(Library.ConfigurationManager.EnvironmentFlag == 1)
             {
-                // LeaderCompPrizeHelper.Instance.Ready("202312"); //领导人达标奖
-                // StatService.Instance.StatUserLevelStartNew();
+                // LeaderCompPrizeHelper.Instance.Ready("202311"); //领导人达标奖
+                // BalancePayBackService.Instance.Start(); //余额支付队列
             }
             if(Library.ConfigurationManager.EnvironmentFlag == 2)
             {