From 8468c88ad2ba95890edc3b2c6729304cc21913be Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Thu, 22 Oct 2020 14:33:25 +0800 Subject: [PATCH] =?UTF-8?q?horseman=E5=AD=97=E6=AE=B5=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=94=B9=E4=B8=BAemployees=20=E6=B5=8B=E8=AF=95=E6=9C=8D?= =?UTF-8?q?=E9=85=8D=E9=80=81=E8=B4=B9=E6=94=B9=E4=B8=BA0.01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/HorsemanController.php | 8 ++++---- .../v3/Implementations/DistributionPriceService.php | 4 +++- app/Service/v3/Implementations/HorsemanService.php | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/Controller/v3/HorsemanController.php b/app/Controller/v3/HorsemanController.php index 67f7189..977aa32 100644 --- a/app/Controller/v3/HorsemanController.php +++ b/app/Controller/v3/HorsemanController.php @@ -22,15 +22,15 @@ class HorsemanController extends BaseController public function setHorsemanCoordinate() { - $horsemanId = $this->request->input('horseman_id', -1); + $employeesId = $this->request->input('employees_id', -1); $coordinate = $this->request->input('coordinate', -1); - return $this->success($this->horsemanService->setHorsemanCoordinate($horsemanId,$coordinate)); + return $this->success($this->horsemanService->setHorsemanCoordinate($employeesId,$coordinate)); } public function getHorsemanCoordinate() { - $horsemanId = $this->request->input('horseman_id', -1); - $coordinate = $this->horsemanService->getHorsemanCoordinate($horsemanId); + $employeesId = $this->request->input('employees_id', -1); + $coordinate = $this->horsemanService->getHorsemanCoordinate($employeesId); return $this->success(['coordinate' => $coordinate]); } diff --git a/app/Service/v3/Implementations/DistributionPriceService.php b/app/Service/v3/Implementations/DistributionPriceService.php index 78ff942..b6e41f1 100644 --- a/app/Service/v3/Implementations/DistributionPriceService.php +++ b/app/Service/v3/Implementations/DistributionPriceService.php @@ -11,7 +11,9 @@ class DistributionPriceService implements DistributionPriceServiceInterface { public function do($distance) { - + if (env('APP_ENV') === 'dev') { + return 0.01; + } $deliveryDistance = config('distance.delivery_distance'); $deliveryDistance = ceil($deliveryDistance/1000); $km = ceil($distance/1000); diff --git a/app/Service/v3/Implementations/HorsemanService.php b/app/Service/v3/Implementations/HorsemanService.php index fd0ae94..94aa008 100644 --- a/app/Service/v3/Implementations/HorsemanService.php +++ b/app/Service/v3/Implementations/HorsemanService.php @@ -29,15 +29,15 @@ class HorsemanService implements HorsemanServiceInterface } public function getOrderList() { - return '接入成功'; + return OrderMain::query()->where('state',3)->limit(5)->get(); } /** * 记录骑手坐标 */ - public function setHorsemanCoordinate($horsemanId,$coordinate){ + public function setHorsemanCoordinate($employeesId,$coordinate){ $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - if(false === $ssdb->exec('set', SsdbKeys::HORSEMAN_COORDINATE.$horsemanId,$coordinate)) { + if(false === $ssdb->exec('set', SsdbKeys::HORSEMAN_COORDINATE.$employeesId,$coordinate)) { return false; } return true; @@ -46,9 +46,9 @@ class HorsemanService implements HorsemanServiceInterface /** * 获取骑手坐标 */ - public function getHorsemanCoordinate($horsemanId){ + public function getHorsemanCoordinate($employeesId){ $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - $params = $ssdb->exec('get', SsdbKeys::HORSEMAN_COORDINATE.$horsemanId); + $params = $ssdb->exec('get', SsdbKeys::HORSEMAN_COORDINATE.$employeesId); if ((false === $params) || empty($params)) { throw new ErrorCodeException(ErrorCode::HORSEMAN_COORDINATE_FAIL, '获取骑手坐标失败');