|
|
|
@ -85,6 +85,10 @@ class UserAddressService implements UserAddressServiceInterface |
|
|
|
{ |
|
|
|
$address = $this->get($userAddressId); |
|
|
|
$market = Market::query()->select('lng','lat')->find($marketId); |
|
|
|
if(empty($address['address']->lng) || empty($address['address']->lat) || empty($market->lng) || empty($market->lat)){ |
|
|
|
throw new ErrorCodeException(ErrorCode::LOCATION_USER_ADDRESS); |
|
|
|
} |
|
|
|
var_dump($address->lng,$market); |
|
|
|
$distance = $this->locationService->getDistanceByTencent($address['address']->lng,$address['address']->lat,$market->lng,$market->lat); |
|
|
|
$distributionPrice = $this->distributionPriceService->do($distance); |
|
|
|
$res['address'] = $address; |
|
|
|
|