Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -50,7 +50,7 @@ class CartModel @@ -50,7 +50,7 @@ class CartModel
50 */ 50 */
51 public static function getCartData($uid, $shoppingKey, $cartType = 'all', $onlyGift = false, $onlyAdvanceBuy = false) 51 public static function getCartData($uid, $shoppingKey, $cartType = 'all', $onlyGift = false, $onlyAdvanceBuy = false)
52 { 52 {
53 - $result = array('cartNav' => true); 53 + $result = array('cartNav' => true, 'commonGoodsCount' => '0', 'presellGoodsCount' => '0');
54 54
55 // 用户是否登录 55 // 用户是否登录
56 if (empty($uid)) { 56 if (empty($uid)) {
@@ -73,21 +73,21 @@ class CartModel @@ -73,21 +73,21 @@ class CartModel
73 break; 73 break;
74 } 74 }
75 75
76 - $ordinaryCount = intval($cart['ordinary_cart_data']['shopping_cart_data']['goods_count']);  
77 - $advanceCount = intval($cart['advance_cart_data']['shopping_cart_data']['goods_count']); 76 + $ordinaryCount = strval($cart['ordinary_cart_data']['shopping_cart_data']['goods_count']);
  77 + $advanceCount = strval($cart['advance_cart_data']['shopping_cart_data']['goods_count']);
78 // 普通购物车和预售购物车都为空 78 // 普通购物车和预售购物车都为空
79 - if ($ordinaryCount === 0 && $advanceCount === 0) { 79 + if ($ordinaryCount === '0' && $advanceCount === '0') {
80 $result['isEmptyCart'] = true; 80 $result['isEmptyCart'] = true;
81 break; 81 break;
82 } 82 }
83 - 83 +
84 /* 普通购物车 */ 84 /* 普通购物车 */
85 $result['commonGoodsCount'] = $ordinaryCount; 85 $result['commonGoodsCount'] = $ordinaryCount;
86 $result['commonCart'] = self::procCartData($cart['ordinary_cart_data'], $onlyGift, $onlyAdvanceBuy); 86 $result['commonCart'] = self::procCartData($cart['ordinary_cart_data'], $onlyGift, $onlyAdvanceBuy);
87 /* 预售购物车 */ 87 /* 预售购物车 */
88 $result['presellGoodsCount'] = $advanceCount; 88 $result['presellGoodsCount'] = $advanceCount;
89 $result['preSellCart'] = self::procCartData($cart['advance_cart_data'], $onlyGift, $onlyAdvanceBuy); 89 $result['preSellCart'] = self::procCartData($cart['advance_cart_data'], $onlyGift, $onlyAdvanceBuy);
90 - }while(0); 90 + } while(false);
91 91
92 return $result; 92 return $result;
93 } 93 }
@@ -156,8 +156,8 @@ class CartModel @@ -156,8 +156,8 @@ class CartModel
156 156
157 if (empty($uid)) { 157 if (empty($uid)) {
158 $result['code'] = 300; 158 $result['code'] = 300;
159 - $reult['message'] = '请先登录';  
160 - $result['data'] = '/signin.html'; 159 + $result['message'] = '请先登录';
  160 + $result['data'] = Helpers::url('/signin.html');
161 161
162 return $result; 162 return $result;
163 } 163 }