Kirin 2 年之前
父节点
当前提交
05bb11c63b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/models/store/StoreProduct.php

+ 1 - 1
app/models/store/StoreProduct.php

@@ -397,7 +397,7 @@ class StoreProduct extends BaseModel
     public static function getProductStock($productId, $uniqueId = '')
     {
         return $uniqueId == '' ?
-            self::where('id', $productId)->value('stock') ?: 0
+            (self::where('id', $productId)->value('stock') ?: 0)
             : StoreProductAttr::uniqueByStock($uniqueId);
     }