...
|
...
|
@@ -344,7 +344,6 @@ class CartModel |
|
|
$result['isLimit'] = true;
|
|
|
}
|
|
|
$pay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
|
|
// print_r($pay);
|
|
|
|
|
|
do {
|
|
|
if (!$pay || $pay['code'] != 200 || empty($pay['data']['goods_list'])) {
|
...
|
...
|
@@ -524,11 +523,14 @@ class CartModel |
|
|
//判断是否为JIT商品
|
|
|
if ($payReturn['shopping_cart_data']['is_multi_package'] == 'Y') {
|
|
|
$result['isJit'] = true;
|
|
|
$result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList));
|
|
|
$jitInfo = array();
|
|
|
if(!empty($orderInfo)){
|
|
|
$jitInfo = array('deliveryId' => $orderInfo['deliveryId'], 'paymentType'=> $orderInfo['paymentType'], 'couponCode' => $orderInfo['couponCode'], 'yohoCoin' => $orderInfo['yohoCoin']);
|
|
|
}
|
|
|
//传递相关参数
|
|
|
$param =array_merge(array('cartType' => $cartType, 'skuList' => $skuList), $jitInfo);
|
|
|
$result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', $param);
|
|
|
}
|
|
|
//测试
|
|
|
// $result['isJit'] = true;
|
|
|
// $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList));
|
|
|
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
|
|
|
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
|
|
|
$result['price'] = Helpers::transPrice($price, true);
|
...
|
...
|
@@ -991,18 +993,31 @@ class CartModel |
|
|
* @param type $skuList cookie中记录的一些订单有关数据
|
|
|
* @param type $orderCode 订单号
|
|
|
* @param type $sessionKey 用户会话
|
|
|
* @return type
|
|
|
* @param type $deliveryId 配送方式,1表示普通快递,2表示顺丰速运
|
|
|
* @param type $paymentType 支付方式,1表示在线支付,2表示货到付款
|
|
|
* @param type $couponCode 优惠券码
|
|
|
* @param type $yohoCoin 使用的YOHO币数量
|
|
|
* @return type
|
|
|
*/
|
|
|
public static function getPackageInfo($uid, $cartType, $skuList, $orderCode, $sessionKey)
|
|
|
public static function getPackageInfo($uid, $cartType, $skuList, $orderCode, $sessionKey, $deliveryId, $paymentType, $couponCode, $yohoCoin)
|
|
|
{
|
|
|
$result = array('jitDetailPage' => true, 'packages' => array());
|
|
|
if ($cartType) {
|
|
|
//购物车中结算页拆单
|
|
|
$carpay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
|
|
if (isset($carpay['data']['shopping_cart_data']['package_list'])) {
|
|
|
$packageList = $carpay['data']['shopping_cart_data']['package_list'];
|
|
|
//返回地址跳转
|
|
|
$result['returnUrl'] = Helpers::url('/cart/index/orderEnsure', array('cartType' => $cartType));
|
|
|
if(isset($deliveryId) && !empty($deliveryId)){
|
|
|
//购物车选择改变字段,重新运算订单数据
|
|
|
$newcar = CartData::orderCompute($uid, $cartType, $deliveryId, $paymentType, $paymentType, $couponCode, $yohoCoin, $skuList);
|
|
|
if(isset($newcar['data']['package_list'])){
|
|
|
$packageList = $newcar['data']['package_list'];
|
|
|
$result['returnUrl'] = Helpers::url('/cart/index/orderEnsure', array('cartType' => $cartType));
|
|
|
}
|
|
|
}else{
|
|
|
$carpay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
|
|
if (isset($carpay['data']['shopping_cart_data']['package_list'])) {
|
|
|
$packageList = $carpay['data']['shopping_cart_data']['package_list'];
|
|
|
//返回地址跳转
|
|
|
$result['returnUrl'] = Helpers::url('/cart/index/orderEnsure', array('cartType' => $cartType));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else {
|
...
|
...
|
|