Jelajahi Sumber

bizGhs\order\classes\OrderItemClass 与 bizGhs\product\classes\ProductClass 混淆,要使用 ProductClass

shizhongqi 4 bulan lalu
induk
melakukan
2494063cbf

+ 0 - 17
biz-ghs/order/classes/OrderItemClass.php

@@ -23,23 +23,6 @@ class OrderItemClass extends BaseClass
 
     public static $baseFile = '\bizGhs\order\models\OrderItem';
 
-    /**
-     * 根据花材清空订单项限购值
-     *
-     * @param int $productId
-     * @return bool
-     */
-    public static function clearLimitBuyByProductId($productId)
-    {
-        $productId = intval($productId);
-        if ($productId <= 0) {
-            return false;
-        }
-
-        self::updateByCondition(['productId' => $productId], ['limitBuy' => 0]);
-        return true;
-    }
-
     //预订单删除花材项 ssh 20240123
     public static function delBookItem($order, $smallId, $params = [])
     {

+ 17 - 0
biz-ghs/product/classes/ProductClass.php

@@ -2797,4 +2797,21 @@ class ProductClass extends BaseClass
         return $customList;
     }
 
+    /**
+     * 根据花材清空订单项限购值
+     *
+     * @param int $productId
+     * @return bool
+     */
+    public static function clearLimitBuyByProductId($productId)
+    {
+        $productId = intval($productId);
+        if ($productId <= 0) {
+            return false;
+        }
+
+        self::updateByCondition(['productId' => $productId], ['limitBuy' => 0]);
+        return true;
+    }
+
 }

+ 1 - 2
common/components/rabbitmq/stockConsumer.php

@@ -6,7 +6,6 @@
 
 namespace common\components\rabbitmq;
 
-use bizGhs\order\classes\OrderItemClass;
 use bizGhs\product\classes\ProductClass;
 use common\components\noticeUtil;
 use mikemadisonweb\rabbitmq\components\ConsumerInterface;
@@ -106,7 +105,7 @@ class stockConsumer implements ConsumerInterface
             return true;
         }
 
-        $result = OrderItemClass::clearLimitBuyByProductId($productId);
+        $result = ProductClass::clearLimitBuyByProductId($productId);
         if ($result) {
             ProductClass::clearLimitBuyClearMark($productId);
             Yii::info('限购字段清理完成: ' . json_encode([