Authored by uedxwg

Merge branch 'feature/new_customer' of http://git.dev.yoho.cn/web/yohobuy into feature/new_customer

# Conflicts:
#	yohobuy/m.yohobuy.com/application/models/Index/Cart.php
@@ -370,9 +370,9 @@ class CartModel @@ -370,9 +370,9 @@ class CartModel
370 370
371 // cookie保存的数据 371 // cookie保存的数据
372 if (!empty($orderInfo)) { 372 if (!empty($orderInfo)) {
373 - $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentType'], $orderInfo['paymentTypeId'] $orderInfo['couponCode'], $orderInfo['yohoCoin'], $skuList);  
374 - }  
375 373
  374 + $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentType'], $orderInfo['couponCode'], $orderInfo['yohoCoin'], $skuList);
  375 + }
376 // 根据地址id查询地址信息 376 // 根据地址id查询地址信息
377 if (isset($orderInfo['address'])) { 377 if (isset($orderInfo['address'])) {
378 $address = $orderInfo['address']; 378 $address = $orderInfo['address'];
@@ -394,10 +394,9 @@ class CartModel @@ -394,10 +394,9 @@ class CartModel
394 394
395 // 配送方式 395 // 配送方式
396 if (isset($payReturn['delivery_way'])) { 396 if (isset($payReturn['delivery_way'])) {
397 - $idArr = array();  
398 $defaultKey = 0; 397 $defaultKey = 0;
399 $oneDeliv = array(); 398 $oneDeliv = array();
400 - 399 + $isDeliveryId = true;
401 $deliveries = $payReturn['delivery_way']; 400 $deliveries = $payReturn['delivery_way'];
402 if (isset($orderCompute['delivery_way']) && !empty($orderCompute['delivery_way'])) { 401 if (isset($orderCompute['delivery_way']) && !empty($orderCompute['delivery_way'])) {
403 $deliveries = $orderCompute['delivery_way']; 402 $deliveries = $orderCompute['delivery_way'];
@@ -414,15 +413,15 @@ class CartModel @@ -414,15 +413,15 @@ class CartModel
414 $oneDeliv['cost'] = $val['delivery_way_cost']; 413 $oneDeliv['cost'] = $val['delivery_way_cost'];
415 ($val['default'] === 'Y') && $defaultKey = $key; 414 ($val['default'] === 'Y') && $defaultKey = $key;
416 415
417 - $idArr[$key] = $oneDeliv['id'];  
418 - 416 + if (isset($orderInfo['deliveryId']) && $orderInfo['deliveryId'] === $oneDeliv['id']) {
  417 + $oneDeliv['isSelected'] = true;
  418 + $isDeliveryId = false;
  419 + }
  420 +
419 $result['dispatchMode'][$key] = $oneDeliv; 421 $result['dispatchMode'][$key] = $oneDeliv;
420 } 422 }
421 -  
422 - if (isset($orderInfo['deliveryId']) && isset($idArr[$orderInfo['deliveryId']])) {  
423 - $flag = array_search($orderInfo['deliveryId'], $idArr);  
424 - $flag !== false && $result['dispatchMode'][$flag]['isSelected'] = true;  
425 - } else { 423 +
  424 + if ($isDeliveryId) {
426 $result['dispatchMode'][$defaultKey]['isSelected'] = true; 425 $result['dispatchMode'][$defaultKey]['isSelected'] = true;
427 } 426 }
428 } 427 }
@@ -296,7 +296,6 @@ class IndexController extends AbstractAction @@ -296,7 +296,6 @@ class IndexController extends AbstractAction
296 $orderInfo = array(); 296 $orderInfo = array();
297 if (!empty($cookieData)) { 297 if (!empty($cookieData)) {
298 $orderInfo = json_decode($cookieData, true); 298 $orderInfo = json_decode($cookieData, true);
299 - // print_r($orderInfo);exit();  
300 $cartType = $orderInfo['cartType']; 299 $cartType = $orderInfo['cartType'];
301 } 300 }
302 301
@@ -330,7 +329,6 @@ class IndexController extends AbstractAction @@ -330,7 +329,6 @@ class IndexController extends AbstractAction
330 'isOrdinaryCart' => ($cartType !== 'advance'), 329 'isOrdinaryCart' => ($cartType !== 'advance'),
331 'orderEnsure' => $order 330 'orderEnsure' => $order
332 ); 331 );
333 - print_r($data);  
334 $this->setTitle('确认订单'); 332 $this->setTitle('确认订单');
335 $this->setNavHeader('确认订单', $returnUrl, false); // 不显示右上角home按钮 333 $this->setNavHeader('确认订单', $returnUrl, false); // 不显示右上角home按钮
336 $this->_view->display('order-ensure', $data); 334 $this->_view->display('order-ensure', $data);