From 275d39b788496566bed3ffce93e748e5370a4ec8 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期六, 10 十一月 2018 16:45:34 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/OpenServerActivity/FlashRushToBuyModel.cs |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/System/OpenServerActivity/FlashRushToBuyModel.cs b/System/OpenServerActivity/FlashRushToBuyModel.cs
index b532991..7f556c9 100644
--- a/System/OpenServerActivity/FlashRushToBuyModel.cs
+++ b/System/OpenServerActivity/FlashRushToBuyModel.cs
@@ -316,13 +316,49 @@
                     }
                     break;
                 case FlashRushToBuySate.Begining:
-                    return true;
+                    if (saleShop != null)
+                    {
+                        for (int i = 0; i < saleShop.items.Length; i++)
+                        {
+                            var saleItem = saleShop.items[i];
+                            if(GetSellSate(saleItem) == 0)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+                    break;
                 case FlashRushToBuySate.End:
                     break;
             }
             return false;
         }
 
+        /// <summary>
+        /// 0 绉掓潃 1 宸蹭拱鍒� 2 宸叉姠鍏�
+        /// </summary>
+        /// <returns></returns>
+        private int GetSellSate(OperationFlashRushToBuy.FlashSaleItem saleItem)
+        {
+            var buyInfo = storeModel.GetBuyShopLimit((uint)saleItem.shopId);
+            var buyCount = 0;
+            int fullRemainNum = saleItem.fullServerLimitNum - GetFullServerBuyCntById(saleItem.shopId);
+            if (buyInfo != null)
+            {
+                buyCount = buyInfo.BuyCnt;
+            }
+            if (buyCount >= saleItem.limitNum)
+            {
+                return 1;
+            }
+
+            if (fullRemainNum <= 0)
+            {
+                return 2;
+            }
+            return 0;
+        }
+
         private void OperationEndEvent(Operation type, int state)
         {
             if (type == Operation.FlashRushToBuy && state == 0)

--
Gitblit v1.8.0