|
@@ -344,7 +344,6 @@ class CartModel |
|
@@ -344,7 +344,6 @@ class CartModel |
344
|
$result['isLimit'] = true;
|
344
|
$result['isLimit'] = true;
|
345
|
}
|
345
|
}
|
346
|
$pay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
346
|
$pay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
347
|
-// print_r($pay);
|
|
|
348
|
|
347
|
|
349
|
do {
|
348
|
do {
|
350
|
if (!$pay || $pay['code'] != 200 || empty($pay['data']['goods_list'])) {
|
349
|
if (!$pay || $pay['code'] != 200 || empty($pay['data']['goods_list'])) {
|
|
@@ -524,11 +523,14 @@ class CartModel |
|
@@ -524,11 +523,14 @@ class CartModel |
524
|
//判断是否为JIT商品
|
523
|
//判断是否为JIT商品
|
525
|
if ($payReturn['shopping_cart_data']['is_multi_package'] == 'Y') {
|
524
|
if ($payReturn['shopping_cart_data']['is_multi_package'] == 'Y') {
|
526
|
$result['isJit'] = true;
|
525
|
$result['isJit'] = true;
|
527
|
- $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList));
|
526
|
+ $jitInfo = array();
|
|
|
527
|
+ if(!empty($orderInfo)){
|
|
|
528
|
+ $jitInfo = array('deliveryId' => $orderInfo['deliveryId'], 'paymentType'=> $orderInfo['paymentType'], 'couponCode' => $orderInfo['couponCode'], 'yohoCoin' => $orderInfo['yohoCoin']);
|
|
|
529
|
+ }
|
|
|
530
|
+ //传递相关参数
|
|
|
531
|
+ $param =array_merge(array('cartType' => $cartType, 'skuList' => $skuList), $jitInfo);
|
|
|
532
|
+ $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', $param);
|
528
|
}
|
533
|
}
|
529
|
- //测试
|
|
|
530
|
-// $result['isJit'] = true;
|
|
|
531
|
-// $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList));
|
|
|
532
|
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
|
534
|
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
|
533
|
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
|
535
|
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
|
534
|
$result['price'] = Helpers::transPrice($price, true);
|
536
|
$result['price'] = Helpers::transPrice($price, true);
|
|
@@ -991,18 +993,31 @@ class CartModel |
|
@@ -991,18 +993,31 @@ class CartModel |
991
|
* @param type $skuList cookie中记录的一些订单有关数据
|
993
|
* @param type $skuList cookie中记录的一些订单有关数据
|
992
|
* @param type $orderCode 订单号
|
994
|
* @param type $orderCode 订单号
|
993
|
* @param type $sessionKey 用户会话
|
995
|
* @param type $sessionKey 用户会话
|
994
|
- * @return type
|
996
|
+ * @param type $deliveryId 配送方式,1表示普通快递,2表示顺丰速运
|
|
|
997
|
+ * @param type $paymentType 支付方式,1表示在线支付,2表示货到付款
|
|
|
998
|
+ * @param type $couponCode 优惠券码
|
|
|
999
|
+ * @param type $yohoCoin 使用的YOHO币数量
|
|
|
1000
|
+ * @return type
|
995
|
*/
|
1001
|
*/
|
996
|
- public static function getPackageInfo($uid, $cartType, $skuList, $orderCode, $sessionKey)
|
1002
|
+ public static function getPackageInfo($uid, $cartType, $skuList, $orderCode, $sessionKey, $deliveryId, $paymentType, $couponCode, $yohoCoin)
|
997
|
{
|
1003
|
{
|
998
|
$result = array('jitDetailPage' => true, 'packages' => array());
|
1004
|
$result = array('jitDetailPage' => true, 'packages' => array());
|
999
|
if ($cartType) {
|
1005
|
if ($cartType) {
|
1000
|
//购物车中结算页拆单
|
1006
|
//购物车中结算页拆单
|
1001
|
- $carpay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
|
|
1002
|
- if (isset($carpay['data']['shopping_cart_data']['package_list'])) {
|
|
|
1003
|
- $packageList = $carpay['data']['shopping_cart_data']['package_list'];
|
|
|
1004
|
- //返回地址跳转
|
|
|
1005
|
- $result['returnUrl'] = Helpers::url('/cart/index/orderEnsure', array('cartType' => $cartType));
|
1007
|
+ if(isset($deliveryId) && !empty($deliveryId)){
|
|
|
1008
|
+ //购物车选择改变字段,重新运算订单数据
|
|
|
1009
|
+ $newcar = CartData::orderCompute($uid, $cartType, $deliveryId, $paymentType, $paymentType, $couponCode, $yohoCoin, $skuList);
|
|
|
1010
|
+ if(isset($newcar['data']['package_list'])){
|
|
|
1011
|
+ $packageList = $newcar['data']['package_list'];
|
|
|
1012
|
+ $result['returnUrl'] = Helpers::url('/cart/index/orderEnsure', array('cartType' => $cartType));
|
|
|
1013
|
+ }
|
|
|
1014
|
+ }else{
|
|
|
1015
|
+ $carpay = CartData::cartPay($uid, $cartType, 0, $skuList);
|
|
|
1016
|
+ if (isset($carpay['data']['shopping_cart_data']['package_list'])) {
|
|
|
1017
|
+ $packageList = $carpay['data']['shopping_cart_data']['package_list'];
|
|
|
1018
|
+ //返回地址跳转
|
|
|
1019
|
+ $result['returnUrl'] = Helpers::url('/cart/index/orderEnsure', array('cartType' => $cartType));
|
|
|
1020
|
+ }
|
1006
|
}
|
1021
|
}
|
1007
|
}
|
1022
|
}
|
1008
|
else {
|
1023
|
else {
|