From d8e637786e6e00fe506703a400f93d67e1e42b1d Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Sat, 5 Sep 2020 12:33:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E6=98=8E=E7=BB=86mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/v3/Withdrawal.php | 28 ++++++++++++++++++ .../v3/BalanceStatementController.php | 15 +++++++++- app/Model/v3/StoreWithdrawal.php | 19 ++++++++++++ .../v3/Implementations/RevenueListService.php | 13 ++++++--- .../Implementations/WithdrawalListService.php | 29 +++++++++++++++++++ .../RevenueListServiceInterface.php | 2 ++ .../WithdrawalListServiceInterface.php | 13 +++++++++ config/autoload/dependencies.php | 1 + config/routes.php | 1 + 9 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 app/Constants/v3/Withdrawal.php create mode 100644 app/Model/v3/StoreWithdrawal.php create mode 100644 app/Service/v3/Implementations/WithdrawalListService.php create mode 100644 app/Service/v3/Interfaces/WithdrawalListServiceInterface.php diff --git a/app/Constants/v3/Withdrawal.php b/app/Constants/v3/Withdrawal.php new file mode 100644 index 0000000..53da40e --- /dev/null +++ b/app/Constants/v3/Withdrawal.php @@ -0,0 +1,28 @@ +request->all(); - return $this->success($this->revenueListService->check(46)); + return $this->success($this->revenueListService->getListByUser(46)); + } + + public function getWithdrawalListByStore() + { + $params = $this->request->all(); + return $this->success($this->withdrawalListService->getListByStore(7)); } } \ No newline at end of file diff --git a/app/Model/v3/StoreWithdrawal.php b/app/Model/v3/StoreWithdrawal.php new file mode 100644 index 0000000..72d1654 --- /dev/null +++ b/app/Model/v3/StoreWithdrawal.php @@ -0,0 +1,19 @@ +attributes['state']); + } +} \ No newline at end of file diff --git a/app/Service/v3/Implementations/RevenueListService.php b/app/Service/v3/Implementations/RevenueListService.php index aefe342..563f8dc 100644 --- a/app/Service/v3/Implementations/RevenueListService.php +++ b/app/Service/v3/Implementations/RevenueListService.php @@ -15,14 +15,19 @@ class RevenueListService implements RevenueListServiceInterface public function check($userId) { - $financialRecord = new FinancialRecord(); - $mod = bcmod((string)$userId, '5', 0); - $financialRecord->suffix($mod); - return $financialRecord::query()->get(); + } public function undo() { // TODO: Implement undo() method. } + + public function getListByUser($userId) + { + $financialRecord = new FinancialRecord(); + $mod = bcmod((string)$userId, '5', 0); + $financialRecord->suffix($mod); + return $financialRecord::query()->get(); + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/WithdrawalListService.php b/app/Service/v3/Implementations/WithdrawalListService.php new file mode 100644 index 0000000..5dd2d1a --- /dev/null +++ b/app/Service/v3/Implementations/WithdrawalListService.php @@ -0,0 +1,29 @@ +where('store_id',$storeId)->get(); + return $res; + } +} \ No newline at end of file diff --git a/app/Service/v3/Interfaces/RevenueListServiceInterface.php b/app/Service/v3/Interfaces/RevenueListServiceInterface.php index 0dfc696..e3b3132 100644 --- a/app/Service/v3/Interfaces/RevenueListServiceInterface.php +++ b/app/Service/v3/Interfaces/RevenueListServiceInterface.php @@ -11,4 +11,6 @@ interface RevenueListServiceInterface public function check($userId); public function undo(); + + public function getListByUser($userId); } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/WithdrawalListServiceInterface.php b/app/Service/v3/Interfaces/WithdrawalListServiceInterface.php new file mode 100644 index 0000000..9b68af4 --- /dev/null +++ b/app/Service/v3/Interfaces/WithdrawalListServiceInterface.php @@ -0,0 +1,13 @@ + \App\Service\v3\Implementations\GoodsActivityService::class, \App\Service\v3\Interfaces\DeliveryMoneyServiceInterface::class => \App\Service\v3\Implementations\DeliveryMoneyService::class, \App\Service\v3\Interfaces\RevenueListServiceInterface::class => \App\Service\v3\Implementations\RevenueListService::class, + \App\Service\v3\Interfaces\WithdrawalListServiceInterface::class => \App\Service\v3\Implementations\WithdrawalListService::class, ]; diff --git a/config/routes.php b/config/routes.php index e3418b5..c853a65 100644 --- a/config/routes.php +++ b/config/routes.php @@ -115,4 +115,5 @@ Router::addGroup('/v3/', function () { Router::post('collectStore/getListByUser', 'App\Controller\v3\CollectStoreController@getListByUser'); Router::post('balanceStatement/getRevenueListByUser', 'App\Controller\v3\BalanceStatementController@getRevenueListByUser'); Router::post('orderOnline/add', 'App\Controller\v3\OrderOnlineController@add'); + Router::post('store/storeWithdrawalList', 'App\Controller\v3\BalanceStatementController@getWithdrawalListByStore'); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class, \App\Middleware\Auth\UserMiddleware::class]]); \ No newline at end of file