作者 lihan
1 个管道 的构建 通过 耗费 0 秒

退货&退款

... ... @@ -340,13 +340,19 @@ class ZjOrderController extends AdminBaseController
$this->error('退款金额需大于0');
}
$return = $this->wxRefund($param['id'], $param['refund_fee']);
if ($return) {
$param['step'] = 9;
$edit = Db::name('zj_order')->update($param);
if (empty($edit)) {
$this->error('订单退款失败1');
} else {
$this->success('订单退款成功');
if ($return !== false) {
$out_refund_no = Db::name('zj_order')->where(['id'=>$param['id']])->value('out_refund_no');
if($out_refund_no == '' && $out_refund_no != $return) {
$param['step'] = 9;
$param['out_refund_no'] = $return;
$edit = Db::name('zj_order')->update($param);
if (empty($edit)) {
$this->error('订单退款失败1');
} else {
$this->success('订单退款成功');
}
}else {
$this->error('禁止重复退款');
}
} else {
$this->error('订单退款失败2');
... ... @@ -369,7 +375,7 @@ class ZjOrderController extends AdminBaseController
$refund = new \Refund($info['out_trade_no'], $totalFee * 100, $info['order_num'], $refundFee * 100);
$return = $refund->refund();
if ($return['return_code'] == 'SUCCESS' && $return['result_code'] == 'SUCCESS') {
return true;
return $return['out_refund_no'];
} else {
return false;
}
... ...