Authored by Rock Zhang

修复预售购物车不显示下架商品的bug

Code Review By Rock Zhang
... ... @@ -12,6 +12,14 @@
</div>
{{/if}}
{{#if offShelveGoods}}
<div class="invalid-goods">
{{# offShelveGoods}}
{{> cart/good}}
{{/ offShelveGoods}}
</div>
{{/if}}
{{#if freebieOrAdvanceBuy}}
<ul class="freebie-and-advance-buy">
{{#if freebie}}
... ...
... ... @@ -773,7 +773,7 @@ class CartModel
do {
// 数据为空时返回空的标志
if (empty($data['goods_list']) && empty($data['sold_out_goods_list'])) {
if (empty($data['goods_list']) && empty($data['sold_out_goods_list']) && empty($data['off_shelves_goods_list'])) {
break;
}
... ... @@ -800,6 +800,12 @@ class CartModel
$result['notValidGoods'] = $notValidGoods;
}
// 下架的商品列表
$offShelveGoods = Helpers::formatCartGoods($data['off_shelves_goods_list'], $isAdvanceCart, false);
if (!empty($offShelveGoods)) {
$result['offShelveGoods'] = $offShelveGoods;
}
// 赠品和加价购商品
if (count($data['gift_list']) || count($data['price_gift'])) {
$result['freebieOrAdvanceBuy'] = true;
... ...