Browse Source

添加取消订单和退款service

master
liangyuyan 6 years ago
parent
commit
1d5fb84b32
  1. 9
      app/Controller/OrderController.php
  2. 24
      app/JsonRpc/OrderService.php
  3. 13
      app/Service/OrderService.php
  4. 13
      app/Service/OrderServiceInterface.php

9
app/Controller/OrderController.php

@ -97,4 +97,13 @@ class OrderController extends BaseController
}
}
/**
* 用户取消订单
*/
public function onlineCancel(){
$globalOrderId = $this->request->input('global_order_id');
return $this->success($this->orderService->onlineCancel($globalOrderId));
}
}

24
app/JsonRpc/OrderService.php

@ -63,4 +63,28 @@ class OrderService implements OrderServiceInterface
}
/**
* 线上订单退款
*/
public function onlineRefund($global_order_id){
Db::beginTransaction();
try{
return [
"status" => 200,
"code" => 0,
"result" => $this->orderService->onlineRefund($global_order_id),
// 'result' => $global_order_id,
"message" => ''
];
} catch (\Exception $e){
return [
"status" => 200,
"code" => 0,
"result" => $this->orderService->onlineRefund($global_order_id),
// 'result' => $global_order_id,
"message" => ''
];
}
}
}

13
app/Service/OrderService.php

@ -700,4 +700,17 @@ class OrderService implements OrderServiceInterface
return false;
}
}
/**
* @inheritDoc
*/
public function onlineCancel($global_order_id){
}
/**
* @inheritDoc
*/
public function onlineRefund($global_order_id){
return 123;
}
}

13
app/Service/OrderServiceInterface.php

@ -48,4 +48,17 @@ interface OrderServiceInterface
*/
public function offlinePaid($global_order_id);
/**
* 线上订单取消
* @param $global_order_id
* @return mixed
*/
public function onlineCancel($global_order_id);
/**
* 线上订单退款
* @param $global_order_id
* @return mixed
*/
public function onlineRefund($global_order_id);
}
Loading…
Cancel
Save