有货判断商品详情页中商品是否售罄的逻辑
Code Review By Rock Zhang
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -264,7 +264,7 @@ class DetailModel | @@ -264,7 +264,7 @@ class DetailModel | ||
264 | 'numInCart' => 0, | 264 | 'numInCart' => 0, |
265 | 'goodsInstore' => $baseInfo['storage'], // 库存量 | 265 | 'goodsInstore' => $baseInfo['storage'], // 库存量 |
266 | ); | 266 | ); |
267 | - $soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0); | 267 | + $soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0 || $totalStorageNum === 0); |
268 | $notForSale = $baseInfo['attribute'] == 2; | 268 | $notForSale = $baseInfo['attribute'] == 2; |
269 | // 显示加入购物车链接 | 269 | // 显示加入购物车链接 |
270 | if (!$soldOut && !$notForSale) { | 270 | if (!$soldOut && !$notForSale) { |
-
Please register or login to post a comment