diff --git a/app/Service/v3/Implementations/StoreLoginService.php b/app/Service/v3/Implementations/StoreLoginService.php index abbed09..0aa7e4e 100644 --- a/app/Service/v3/Implementations/StoreLoginService.php +++ b/app/Service/v3/Implementations/StoreLoginService.php @@ -11,7 +11,13 @@ class StoreLoginService implements StoreLoginServiceInterface { public function do($account,$password) { - $storeUsersModel = StoreUsers::query()->where('username',$account)->first(); + $storeUsersModel = StoreUsers::query()->where([ + ['username','=',$account], + ['status','=',2] + ])->first(); + if(empty($storeUsersModel)){ + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); + } $password = $this->stringHash($password,$storeUsersModel->salt); if($storeUsersModel->password === $password){ return $storeUsersModel; diff --git a/app/Service/v3/Implementations/UserAddressService.php b/app/Service/v3/Implementations/UserAddressService.php index ed5cadc..ebfc46f 100644 --- a/app/Service/v3/Implementations/UserAddressService.php +++ b/app/Service/v3/Implementations/UserAddressService.php @@ -87,6 +87,7 @@ class UserAddressService implements UserAddressServiceInterface $market = Market::query()->select('lng','lat')->find($marketId); $distance = $this->locationService->getDistanceByTencent($address['address']->lng,$address['address']->lat,$market->lng,$market->lat); $distributionPrice = $this->distributionPriceService->do($distance); + var_dump($distance); $res['address'] = $address; $res['delivery_distance'] = $distance; $res['distribution_price'] = $distributionPrice;