From 1d5fb84b32d82493a21f15338f814421d4aede9f Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Tue, 25 Aug 2020 09:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=96=E6=B6=88=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=92=8C=E9=80=80=E6=AC=BEservice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/OrderController.php | 9 +++++++++ app/JsonRpc/OrderService.php | 24 ++++++++++++++++++++++++ app/Service/OrderService.php | 13 +++++++++++++ app/Service/OrderServiceInterface.php | 13 +++++++++++++ 4 files changed, 59 insertions(+) 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