Showing
3 changed files
with
6 additions
and
6 deletions
@@ -108,7 +108,7 @@ class CartData | @@ -108,7 +108,7 @@ class CartData | ||
108 | * @param string $shoppingKey 未登录用户唯一识别码 | 108 | * @param string $shoppingKey 未登录用户唯一识别码 |
109 | * @return array 接口返回的数据 | 109 | * @return array 接口返回的数据 |
110 | */ | 110 | */ |
111 | - public static function removeFromCart($uid, $sku, $shoppingKey, $hasPromotion = false) | 111 | + public static function removeFromCart($uid, $sku, $shoppingKey) |
112 | { | 112 | { |
113 | $param = Yohobuy::param(); | 113 | $param = Yohobuy::param(); |
114 | $param['method'] = 'app.Shopping.removeAndCart'; | 114 | $param['method'] = 'app.Shopping.removeAndCart'; |
@@ -168,13 +168,13 @@ class CartModel | @@ -168,13 +168,13 @@ class CartModel | ||
168 | * @param string $shoppingKey 未登录用户唯一识别码 | 168 | * @param string $shoppingKey 未登录用户唯一识别码 |
169 | * @return array 接口返回的数据 | 169 | * @return array 接口返回的数据 |
170 | */ | 170 | */ |
171 | - public static function removeFromCart($uid, $sku, $count, $shoppingKey, $hasPromotion = false) | 171 | + public static function removeFromCart($uid, $sku, $count, $shoppingKey, $promotionId = 0) |
172 | { | 172 | { |
173 | $result = array('code' => 400, 'message' => '出错啦~'); | 173 | $result = array('code' => 400, 'message' => '出错啦~'); |
174 | 174 | ||
175 | // 处理sku | 175 | // 处理sku |
176 | - $sku_list = json_encode(array(array('product_sku'=>$sku,'buy_number'=>intval($count), 'promotion_id'=>$hasPromotion))); | ||
177 | - $remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey, $hasPromotion); | 176 | + $sku_list = json_encode(array(array('product_sku'=>$sku,'buy_number'=>intval($count), 'promotion_id'=>$promotionId))); |
177 | + $remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey); | ||
178 | if ($remove && isset($remove['code'])) { | 178 | if ($remove && isset($remove['code'])) { |
179 | $result['code'] = $remove['code']; | 179 | $result['code'] = $remove['code']; |
180 | $result['message'] = $remove['message']; | 180 | $result['message'] = $remove['message']; |
@@ -122,9 +122,9 @@ class IndexController extends AbstractAction | @@ -122,9 +122,9 @@ class IndexController extends AbstractAction | ||
122 | $count = $this->post('count', 0); | 122 | $count = $this->post('count', 0); |
123 | $uid = $this->getUid(true); | 123 | $uid = $this->getUid(true); |
124 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 124 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
125 | - $hasPromotion = $this->post('hasPromotion', false); | 125 | + $promotionId = $this->post('promotionId', 0); |
126 | 126 | ||
127 | - $result = CartModel::removeFromCart($uid, $sku, $count, $shoppingKey, $hasPromotion); | 127 | + $result = CartModel::removeFromCart($uid, $sku, $count, $shoppingKey, $promotionId); |
128 | } | 128 | } |
129 | 129 | ||
130 | $this->echoJson($result); | 130 | $this->echoJson($result); |
-
Please register or login to post a comment