Authored by Rock Zhang

修复限购商品结算的连接跳转问题

Code Review By Rock Zhang
... ... @@ -331,10 +331,9 @@ class CartModel
$result = array();
$skuList = '';
$hasSkuListCookie = isset($orderInfo['skuList']);
$isLimitGoods = $hasSkuListCookie || (!empty($sku) && !empty($skn) && !empty($buyNumber));
if ($isLimitGoods) { // 存在sku,skn和buyNumber或者cookie中有skuList时为限购商品
$skuList = $hasSkuListCookie ? $orderInfo['skuList'] : json_encode(array(
$isLimitGoods = !empty($sku) && !empty($skn) && !empty($buyNumber);
if ($isLimitGoods) { // 存在sku,skn和buyNumber时为限购商品
$skuList = json_encode(array(
array(
'type' => 'limitcode',
'limitproductcode' => $limitProductCode,
... ... @@ -343,8 +342,6 @@ class CartModel
'buy_number' => $buyNumber
)
));
$result['skn'] = $skn;
$result['isLimit'] = true;
}
... ...
... ... @@ -321,7 +321,7 @@ class IndexController extends AbstractAction
// 限购商品时更换返回按钮地址
if (isset($order['isLimit'])) {
$returnUrl = Helpers::url('/product/show_' . $order['skn'] . '.html');;
$returnUrl = Helpers::url('/product/show_' . $skn . '.html');
}
$data = array(
... ... @@ -400,9 +400,20 @@ class IndexController extends AbstractAction
// 审判跳转登录页
$this->auditJumpLogin();
// 获取cookie中的信息
$cookieData = $this->getCookie('order-info', null);
$orderInfo = array();
if (!empty($cookieData)) {
$orderInfo = json_decode($cookieData, true);
}
$returnUrl = Helpers::url('/cart/index/orderEnsure');
if (isset($orderInfo['limitUrlSufix'])) {
$returnUrl .= $orderInfo['limitUrlSufix'];
}
// 设置网站标题
$this->setTitle('选择地址');
$this->setNavHeader('选择地址', Helpers::url('/cart/index/orderEnsure'), false);
$this->setNavHeader('选择地址', $returnUrl, false);
$uid = $this->getUid(true);
$address = UserModel::getAddressData($uid);
... ...