Authored by Rock Zhang

修复购物车赠品有关bug(价格显示,赠品数量显示)

Code Review By Rock Zhang
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 {{else}} 12 {{else}}
13 {{# freebie}} 13 {{# freebie}}
14 <div class="advance-block gift-block" data-promotion-id="{{promotionId}}"> 14 <div class="advance-block gift-block" data-promotion-id="{{promotionId}}">
15 - <p class="title">{{title}}</p> 15 + <p class="title">{{promotionTitle}}</p>
16 {{#goods}} 16 {{#goods}}
17 {{> cart/gift-advance-good}} 17 {{> cart/gift-advance-good}}
18 {{/goods}} 18 {{/goods}}
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <span class="iconfont">&#xe620;</span> 17 <span class="iconfont">&#xe620;</span>
18 赠品 18 赠品
19 <span class="iconfont icon-right-arrow">&#xe614;</span> 19 <span class="iconfont icon-right-arrow">&#xe614;</span>
20 - <span class="count">{{count}}</span> 20 + <span class="count">{{giftCount}}</span>
21 </a> 21 </a>
22 </li> 22 </li>
23 {{/ freebie}} 23 {{/ freebie}}
@@ -73,8 +73,7 @@ class CartModel @@ -73,8 +73,7 @@ class CartModel
73 73
74 $cart = $cartData['data']; 74 $cart = $cartData['data'];
75 75
76 - $cartTypes = array('ordinary', 'advance', 'all');  
77 - if (!in_array($cartType, $cartTypes)) { // 加价购或者赠品数据 76 + if ($onlyGift || $onlyAdvanceBuy) { // 加价购或者赠品数据
78 $result = self::procCartData($cart['ordinary_cart_data'], $onlyGift, $onlyAdvanceBuy); 77 $result = self::procCartData($cart['ordinary_cart_data'], $onlyGift, $onlyAdvanceBuy);
79 break; 78 break;
80 } 79 }