diff --git a/app/Controller/OrderController.php b/app/Controller/OrderController.php index 4896c6f..d91a1c8 100644 --- a/app/Controller/OrderController.php +++ b/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)); + } + } \ No newline at end of file diff --git a/app/JsonRpc/OrderService.php b/app/JsonRpc/OrderService.php index 10cf513..5ecdadf 100644 --- a/app/JsonRpc/OrderService.php +++ b/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" => '' + ]; + } + } } \ No newline at end of file diff --git a/app/Service/OrderService.php b/app/Service/OrderService.php index 6b02129..2f74461 100644 --- a/app/Service/OrderService.php +++ b/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; + } } \ No newline at end of file diff --git a/app/Service/OrderServiceInterface.php b/app/Service/OrderServiceInterface.php index 01cb413..397bc2c 100644 --- a/app/Service/OrderServiceInterface.php +++ b/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); } \ No newline at end of file