Просмотр исходного кода

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

shish 2 месяцев назад
Родитель
Сommit
3374d99f93

+ 1 - 1
app-ghs/controllers/ItemController.php

@@ -77,7 +77,7 @@ class ItemController extends BaseController
         if ($item->mainId != $this->mainId) {
             util::fail('不是你的花材');
         }
-        ProductClass::clearLimitBuyCache($id);
+        ProductClass::clearLimitBuyCache($id, false);
         util::complete('清除成功');
     }
 

+ 6 - 4
biz-ghs/product/classes/ProductClass.php

@@ -3152,9 +3152,9 @@ class ProductClass extends BaseClass
     /**
      * 清空限购的缓存
      * @param int $productId
-     * @param bool $cleanAll
+     * @param bool $clearAll
      */
-    public static function clearLimitBuyCache($productId)
+    public static function clearLimitBuyCache($productId, $clearAll = true)
     {
         $limitKey = self::LIMIT_BUY_KEY . $productId;
         $arr = Yii::$app->redis->executeCommand('HKEYS', [$limitKey]);
@@ -3164,8 +3164,10 @@ class ProductClass extends BaseClass
             }
         }
 
-        self::clearLimitBuyClearMark($productId);
-        self::clearLimitBuyClearLoopConfig($productId);
+        if ($clearAll === true) {
+            self::clearLimitBuyClearMark($productId);
+            self::clearLimitBuyClearLoopConfig($productId);
+        }
     }
 
     // 校验清空限购消息是否是当前有效版本

+ 5 - 3
biz-hd/product/classes/ProductClass.php

@@ -562,7 +562,7 @@ class ProductClass extends BaseClass
     }
 
     //清空限购的缓存
-    public static function clearLimitBuyCache($productId)
+    public static function clearLimitBuyCache($productId, $clearAll = true)
     {
         $limitKey = self::LIMIT_BUY_KEY . $productId;
         $arr = Yii::$app->redis->executeCommand('HKEYS', [$limitKey]);
@@ -571,8 +571,10 @@ class ProductClass extends BaseClass
                 self::baseClearLimitBuy($productId, $field);
             }
         }
-        self::clearLimitBuyClearMark($productId);
-        self::clearLimitBuyClearLoopConfig($productId);
+        if ($clearAll === true) {
+            self::clearLimitBuyClearMark($productId);
+            self::clearLimitBuyClearLoopConfig($productId);
+        }
     }
 
     public static function getHasLimitBuyList($product)