diff --git a/app/controller/api/server/StoreOrder.php b/app/controller/api/server/StoreOrder.php index b127ab04..5401fe1d 100644 --- a/app/controller/api/server/StoreOrder.php +++ b/app/controller/api/server/StoreOrder.php @@ -338,6 +338,39 @@ class StoreOrder extends BaseController return app('json')->success('订单核销成功'); } + /** + * 订单结算 + * @return mixed + * @throws \Psr\SimpleCache\InvalidArgumentException + */ + public function settle(StoreOrderRepository $repository) + { + $id = $this->request->param('id/d'); + $payType = $this->request->param('pay_type'); + try { + $data = $repository->settle($id, $payType, $this->request->userInfo()); + return app('json')->success('success', $data); + } catch (\Exception $e) { + return app('json')->fail($e->getMessage()); + } + } + + /** + * 确认接单 + * @return mixed + */ + public function confirm(StoreOrderRepository $repository) + { + $id = $this->request->param('id/d'); + $type = $this->request->param('type/d'); + try { + $repository->confirm($this->request->userInfo(), $id, $type); + return app('json')->success('success'); + } catch (\Exception $e) { + return app('json')->fail($e->getMessage()); + } + } + /** * 采购订单列表 * @param $merId diff --git a/app/controller/api/store/order/StoreOrder.php b/app/controller/api/store/order/StoreOrder.php index 7cd38a64..d1b3f03f 100644 --- a/app/controller/api/store/order/StoreOrder.php +++ b/app/controller/api/store/order/StoreOrder.php @@ -302,37 +302,4 @@ class StoreOrder extends BaseController return app('json')->success($res); } - /** - * 订单结算 - * @return mixed - * @throws \Psr\SimpleCache\InvalidArgumentException - */ - public function settle() - { - $id = $this->request->param('id/d'); - $payType = $this->request->param('pay_type'); - try { - $data = $this->repository->settle($id, $payType, $this->request->userInfo()); - return app('json')->success('success', $data); - } catch (\Exception $e) { - return app('json')->fail($e->getMessage()); - } - } - - /** - * 确认接单 - * @return mixed - */ - public function confirm() - { - $id = $this->request->param('id/d'); - $type = $this->request->param('type/d'); - try { - $this->repository->confirm($this->request->userInfo(), $id, $type); - return app('json')->success('success'); - } catch (\Exception $e) { - return app('json')->fail($e->getMessage()); - } - } - } diff --git a/route/api.php b/route/api.php index c10547c6..131eb8e8 100644 --- a/route/api.php +++ b/route/api.php @@ -90,8 +90,6 @@ Route::group('api/', function () { Route::get('verify_code/:id', '/verifyCode'); Route::post('receipt/:id', '/createReceipt'); Route::get('delivery/:id', '/getOrderDelivery'); - Route::post('settle', '/settle'); - Route::post('confirm', '/confirm'); })->prefix('api.store.order.StoreOrder'); // 预售 @@ -311,6 +309,8 @@ Route::group('api/', function () { Route::get('/delivery_config', '/getDeliveryConfig'); Route::get('/delivery_options', '/getDeliveryOptions'); Route::get('/purchaseOrder', '/purchaseOrder'); + Route::post('/settle', '/settle'); + Route::post('/confirm', '/confirm'); })->prefix('api.server.StoreOrder')->middleware(\app\common\middleware\MerchantServerMiddleware::class,0);