Authored by cailing

PC取消订单原因优化

... ... @@ -50,12 +50,17 @@ class OrderData
* @param type $orderCode
* @return type
*/
public static function cancelUserOrder($uid, $orderCode)
public static function cancelUserOrder($uid, $orderCode, $reason = false, $reasonId = false)
{
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.close';
$param['uid'] = $uid;
$param['order_code'] = $orderCode;
//取消订单原因
if ($reasonId) {
$param['reasonId'] = $reasonId;
$param['reasons'] = $reason;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ... @@ -147,4 +152,20 @@ class OrderData
// 调用接口获得数据
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
* 取消订单原因列表
* @return type
*/
public static function closeReasons()
{
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.closeReasons';
$param['client_secret'] = Sign::getSign($param);
// 调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...

48.3 KB | W: | H:

48.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.64 KB | W: | H:

8.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -224,6 +224,8 @@ class OrderModel
$detail['remark'] = $orderDetail['remark'];
$detail['operation'] = self::getOrderDetailOp($orderDetail['order_code'], $orderDetail['payment'], $orderDetail['status'], $orderDetail['is_cancel'], $orderDetail['payment_status'], $orderDetail['payment_type'], $orderDetail['order_type'], $orderDetail['attribute'], $orderDetail['refund_status']); //,$orderDetail['order_type_value']
$detail['packages'] = CartModel::getPackageInfo($orderDetail);
//判断是否可以修改地址
$result['changeable'] = $orderDetail['can_update_delivery_address'] == 'Y' ? 'true' : 'false';
}
return $detail;
}
... ... @@ -330,7 +332,7 @@ class OrderModel
$result['courierNumbe'] = isset($logistics['data']['express_number']) ? $logistics['data']['express_number'] : '';
$expressDetail = isset($logistics['data']['express_detail']) ? $logistics['data']['express_detail'] : array();
if (isset($expressDetail) && $expressDetail) {
$logisticsTmp = $result['logistics'][0];//暂存
$logisticsTmp = $result['logistics'][0]; //暂存
$result['logistics'] = array();
foreach ($expressDetail as $value) {
$pos = stripos($value['accept_address'], ' ') / 3;
... ... @@ -344,7 +346,7 @@ class OrderModel
}
}
//把最初的处理放最后
$result['logistics'][]=$logisticsTmp;
$result['logistics'][] = $logisticsTmp;
}
}
}
... ...
... ... @@ -65,6 +65,9 @@ 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));
}
... ... @@ -98,7 +101,7 @@ class OrdersController extends WebAction
'userThumb' => UserModel::getUserHeadImg($uid),
'homeNav' => $leftNav
);
$packages=false;
$packages = false;
if ($detail) {
$data += array(
'orderNum' => $detail['orderNum'],
... ... @@ -185,8 +188,10 @@ class OrdersController extends WebAction
break;
}
$uid = $this->auditJumpLogin();
$orderCode = trim($this->post('orderCode', ''));
$data = OrderData::cancelUserOrder($uid, $orderCode);
$orderCode = trim($this->post('orderCode', ''));//订单编号
$reason = $this->get('reason', ''); //取消订单原因
$reasonid = $this->get('reasonId', ''); //取消原因id
$data = OrderData::cancelUserOrder($uid, $orderCode, $reason, $reasonid);
if (!isset($data['code'])) {
break;
}
... ...