Ver Fonte

wifi开机奖励可以再次发放

lcl há 9 meses atrás
pai
commit
7beaf940fe

+ 14 - 3
AppStart/Helper/LeaderPrizeService.cs

@@ -33,10 +33,21 @@ namespace MySystem
                     {
                         int PosId = int.Parse(function.CheckInt(data));
                         WebCMSEntities db = new WebCMSEntities();
-                        if(!db.UserAccountRecord.Any(m => m.QueryCount == PosId && m.ChangeType == 116))
+                        PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.LeaderUserId > 0);
+                        if (pos != null)
                         {
-                            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.LeaderUserId > 0);
-                            if (pos != null)
+                            bool IsGet = true;
+                            if(pos.BrandId == 23 || pos.BrandId == 24 || pos.BrandId == 25 || pos.BrandId == 26)
+                            {
+                                int Count = db.UserAccountRecord.Count(m => m.QueryCount == PosId && m.ChangeType == 116);
+                                int Count1 = db.WifiTradeRecord.Count(m => m.SnNo == pos.PosSn);
+                                IsGet = Count >= Count1;
+                            }
+                            else
+                            {
+                                IsGet = db.UserAccountRecord.Any(m => m.QueryCount == PosId && m.ChangeType == 116);
+                            }
+                            if(!IsGet)
                             {
                                 decimal ChangeAmount = 10;
                                 if(pos.BrandId == 14)

+ 15 - 4
AppStart/Helper/OperatePrizeService.cs

@@ -33,12 +33,23 @@ namespace MySystem
                     {
                         int PosId = int.Parse(function.CheckInt(data));
                         WebCMSEntities db = new WebCMSEntities();
-                        if(!db.UserAccountRecord.Any(m => m.QueryCount == PosId && m.ChangeType == 121))
+                        PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId);
+                        if (pos != null)
                         {
-                            OpModels.WebCMSEntities spdb = new OpModels.WebCMSEntities();
-                            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId);
-                            if (pos != null)
+                            bool IsGet = true;
+                            if(pos.BrandId == 23 || pos.BrandId == 24 || pos.BrandId == 25 || pos.BrandId == 26)
                             {
+                                int Count = db.UserAccountRecord.Count(m => m.QueryCount == PosId && m.ChangeType == 121);
+                                int Count1 = db.WifiTradeRecord.Count(m => m.SnNo == pos.PosSn);
+                                IsGet = Count >= Count1;
+                            }
+                            else
+                            {
+                                IsGet = db.UserAccountRecord.Any(m => m.QueryCount == PosId && m.ChangeType == 121);
+                            }
+                            if(!IsGet)
+                            {
+                                OpModels.WebCMSEntities spdb = new OpModels.WebCMSEntities();
                                 int OpId = 0;
                                 int UserId = pos.BuyUserId;
                                 while(UserId > 0)

+ 11 - 1
AppStart/Helper/StatService.cs

@@ -1239,7 +1239,17 @@ namespace MySystem
                         if (pos != null)
                         {
                             function.WriteLog("sn:" + pos.PosSn, "开机奖励发放日志");
-                            bool IsGet = db.OpenRewardDetail.Any(m => m.SnNo == pos.PosSn);
+                            bool IsGet = true;
+                            if(pos.BrandId == 23 || pos.BrandId == 24 || pos.BrandId == 25 || pos.BrandId == 26)
+                            {
+                                int Count = db.OpenRewardDetail.Count(m => m.SnNo == pos.PosSn);
+                                int Count1 = db.WifiTradeRecord.Count(m => m.SnNo == pos.PosSn);
+                                IsGet = Count >= Count1;
+                            }
+                            else
+                            {
+                                IsGet = db.OpenRewardDetail.Any(m => m.SnNo == pos.PosSn);
+                            }
                             if (pos.BindingTime > DateTime.Now.AddDays(-30) && !IsGet)
                             {
                                 decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));