Authored by 郭成尧

'调整获取参数方式'

... ... @@ -249,6 +249,7 @@ class ReturnsData
$param['method'] = 'app.refund.cancel';
$param['id'] = $id;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(yohobuy::API_URL, $param);
}
... ... @@ -264,6 +265,7 @@ class ReturnsData
$param['method'] = 'app.change.cancel';
$param['id'] = $id;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(yohobuy::API_URL, $param);
}
... ...
... ... @@ -321,6 +321,19 @@ class ReturnsModel
}
$result['orderCode'] = $orderCode;
$result['reason'] = $data['data']['return_reason'];
// tar note 对数组做处理,为不显示的添加 inactive
if (isset($data['data']['special_exchange_reason'])) {
foreach ($result['reason'] as $key => $item) {
if (!in_array($item, $data['data']['special_exchange_reason'])) {
$result['reason'][$key]['inactive'] = true;
}
}
}
// 对原因排序
asort($result['reason']);
//计算相关支付细节
$result['amount'] = $amount - $data['data']['yoho_coin_num'] - $data['data']['coupon_amount'];
$result['yohoCoin'] = $data['data']['yoho_coin_num'];
... ... @@ -402,6 +415,9 @@ class ReturnsModel
}
}
// 对原因排序
asort($result['reason']);
$result['orderCode'] = $orderCode;
//换货地址相关数据(邮编为可空参数)
... ...
... ... @@ -279,11 +279,11 @@ class ReturnsController extends WebAction
*/
public function cancelRefundAction()
{
$orderId = $this->get('id');
$uid = $this->getUid();
if (!$this->isAjax()) {
return;
}
$orderId = $this->post('id');
$uid = $this->getUid();
$res = ReturnsData::cancelRefund($orderId, $uid);
$result = array();
if ($res['code'] === 200) {
... ... @@ -298,11 +298,11 @@ class ReturnsController extends WebAction
*/
public function cancelChangeAction()
{
$orderId = $this->get('id');
$uid = $this->getUid();
if (!$this->isAjax()) {
return;
}
$orderId = $this->post('id');
$uid = $this->getUid();
$res = ReturnsData::cancelChange($orderId, $uid);
$result = array();
if ($res['code'] === 200) {
... ...