Authored by yangyang

修复购物车选择bug(恢复4.8日版本)

... ... @@ -108,7 +108,7 @@ class CartData
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku, $shoppingKey, $hasPromotion = false)
public static function removeFromCart($uid, $sku, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.removeAndCart';
... ...
... ... @@ -168,13 +168,13 @@ class CartModel
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku, $count, $shoppingKey, $hasPromotion = false)
public static function removeFromCart($uid, $sku, $count, $shoppingKey, $promotionId = 0)
{
$result = array('code' => 400, 'message' => '出错啦~');
// 处理sku
$sku_list = json_encode(array(array('product_sku'=>$sku,'buy_number'=>intval($count), 'promotion_id'=>$hasPromotion)));
$remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey, $hasPromotion);
$sku_list = json_encode(array(array('product_sku'=>$sku,'buy_number'=>intval($count), 'promotion_id'=>$promotionId)));
$remove = CartData::removeFromCart($uid, $sku_list, $shoppingKey);
if ($remove && isset($remove['code'])) {
$result['code'] = $remove['code'];
$result['message'] = $remove['message'];
... ...
... ... @@ -122,9 +122,9 @@ class IndexController extends AbstractAction
$count = $this->post('count', 0);
$uid = $this->getUid(true);
$shoppingKey = Helpers::getShoppingKeyByCookie();
$hasPromotion = $this->post('hasPromotion', false);
$promotionId = $this->post('promotionId', 0);
$result = CartModel::removeFromCart($uid, $sku, $count, $shoppingKey, $hasPromotion);
$result = CartModel::removeFromCart($uid, $sku, $count, $shoppingKey, $promotionId);
}
$this->echoJson($result);
... ...