Authored by cailing

订单修改

... ... @@ -174,13 +174,18 @@ class OrderData
* @param type $address_id
* @return type
*/
public static function updateDeliveryAddress($order_code, $address_id)
public static function updateDeliveryAddress($order_code, $address_id, $user_name, $area_code, $address, $mobile, $phone)
{
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.updateDeliveryAddress';
$param['order_code'] = $order_code;
$param['address_id'] = $address_id;
$param['user_name'] = $user_name;
$param['area_code'] = $area_code;
$param['address'] = $address;
$param['mobile'] = $mobile;
$param['phone'] = $phone;
$param['client_secret'] = Sign::getSign($param);
// 调用接口获得数据
... ...
... ... @@ -48,6 +48,9 @@ class OrdersController extends WebAction
$page = isset($orders['pager']['page']) ? $orders['pager']['page'] : 0;
unset($orders['pager']);
$paging->setTotal($total)->setSize($limit)->setQuery(array('page' => $page, 'type' => $type));
//取消订单原因列表
$resons = OrderData::closeReasons();
$cancelReason = isset($resons['data']) ? $resons['data'] : '';
//数据整合
$data = array(
... ... @@ -55,6 +58,7 @@ class OrdersController extends WebAction
'userThumb' => UserModel::getUserHeadImg($uid),
'homeNav' => $leftNav,
'tabs' => OrderModel::getOrderTabs($type),
'cancelReason' => $cancelReason,
'pager' => array(
'count' => $total,
'curPage' => $page,
... ... @@ -66,9 +70,6 @@ class OrdersController extends WebAction
//历史订单/普通订单
$orderKey = ($type == ChannelConfig::$historyType) ? 'historyOrders' : 'orders';
$data[$orderKey] = $orders;
//取消订单原因列表
$resons = OrderData::closeReasons();
$data['cancelReason'] = isset($resons['data']) ? $resons['data'] : '';
$this->_view->display('orders', array('meOrdersPage' => true, 'meOrders' => $data));
}
... ... @@ -95,6 +96,7 @@ class OrdersController extends WebAction
$detail = OrderModel::getOrderDetail($uid, $orderCode);
//取消订单原因列表
$resons = OrderData::closeReasons();
$cancelReason = isset($resons['data']) ? $resons['data'] : '';
//非当前用户的订单,跳转个首
if (isset($detail['code']) && $detail['code'] == 400) {
$this->go(Helpers::url('/home'));
... ... @@ -118,7 +120,6 @@ class OrdersController extends WebAction
'orderBalance' => isset($detail['orderBalance']) ? $detail['orderBalance'] : array(),
'operation' => $detail['operation'],
'totalYoho' => $detail['yoho_give_coin'],
'cancelReason' => isset($resons['data']) ? $resons['data'] : '',
);
if (isset($detail['noramlPayMode'])) {
$data['orderInfo'] = $detail['orderInfo'];
... ... @@ -132,7 +133,7 @@ class OrdersController extends WebAction
$packages = $detail['packages'];
}
$this->_view->display('order-detail', array('meOrdersPage' => true, 'meOrderDetail' => $data, 'packages' => $packages));
$this->_view->display('order-detail', array('meOrdersPage' => true, 'meOrderDetail' => $data, 'packages' => $packages, 'cancelReason' => $cancelReason));
}
/**
... ... @@ -262,11 +263,16 @@ class OrdersController extends WebAction
//获取相关参数
$order_code = $this->get('orderCode', ''); //订单号
$address_id = $this->get('addressId', ''); //地址id
$user_name = $this->get('user_name', ''); //收货人
$area_code = $this->get('area_code', ''); //区号
$address = $this->get('address', ''); //地址
$mobile = $this->get('mobile', ''); //手机号码
$phone = $this->get('phone', ''); //固定电话
if (!$order_code || !$address_id) {
$result = array('code' => 400, 'message' => '缺失必填项', 'data' => '');
break;
}
$result = OrderData::updateDeliveryAddress($order_code, $address_id);
$result = OrderData::updateDeliveryAddress($order_code, $address_id, $user_name, $area_code, $address, $mobile, $phone);
if (!isset($result['code'])) {
break;
}
... ...