|
@@ -546,7 +546,7 @@ class OrderRefund extends BaseModel
|
|
|
return $this->error();
|
|
|
}
|
|
|
model('order_goods')->startTrans();
|
|
|
- //try {
|
|
|
+ try {
|
|
|
|
|
|
$update_data = array(
|
|
|
"refund_time" => time(),
|
|
@@ -558,7 +558,7 @@ class OrderRefund extends BaseModel
|
|
|
$res = model('order_goods')->update($update_data, [['order_goods_id', "=", $data['order_goods_id']]]);
|
|
|
|
|
|
$this->finishAction($data['order_goods_id']);
|
|
|
- echo "<pre>";print_r('111');exit;
|
|
|
+ //echo "<pre>";print_r('111');exit;
|
|
|
$order_info = model('order')->getInfo(['order_id' => $order_goods_info['order_id']]);
|
|
|
//调用各种订单
|
|
|
switch ($order_info['order_type']) {
|
|
@@ -585,10 +585,10 @@ class OrderRefund extends BaseModel
|
|
|
// event('OrderRefundFinish', $order_goods_info);//传入订单类型以及订单项id
|
|
|
model('order_goods')->commit();
|
|
|
return $this->success();
|
|
|
- /*} catch (\Exception $e) {
|
|
|
+ } catch (\Exception $e) {
|
|
|
model('order_goods')->rollback();
|
|
|
return $this->error('', $e->getMessage());
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -603,7 +603,7 @@ class OrderRefund extends BaseModel
|
|
|
|
|
|
|
|
|
model('order_goods')->startTrans();
|
|
|
- //try {
|
|
|
+ try {
|
|
|
$order_info = model('order')->getInfo(['order_id' => $order_goods_info['order_id']]);
|
|
|
|
|
|
|
|
@@ -638,7 +638,7 @@ class OrderRefund extends BaseModel
|
|
|
if($refund_pay_money > 0){
|
|
|
$pay_model = new Pay();
|
|
|
$refund_result = $pay_model->refund($order_goods_info["refund_no"], $refund_pay_money, $order_info["out_trade_no"], '', $order_info["pay_money"], $order_info["site_id"], 1);
|
|
|
- echo "<pre>";print_r('2222');exit;
|
|
|
+ //echo "<pre>";print_r('2222');exit;
|
|
|
if($refund_result["code"] < 0) {
|
|
|
model('order_goods')->rollback();
|
|
|
return $refund_result;
|
|
@@ -667,10 +667,10 @@ class OrderRefund extends BaseModel
|
|
|
event('OrderRefundFinish', $order_goods_info);//传入订单类型以及订单项id
|
|
|
model('order_goods')->commit();
|
|
|
return $this->success();
|
|
|
- /*} catch (\Exception $e) {
|
|
|
+ } catch (\Exception $e) {
|
|
|
model('order_goods')->rollback();
|
|
|
return $this->error('', $e->getMessage());
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
/**
|
|
|
* 判断当前订单是否全部退款完毕
|