Browse Source

Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix

master
weigang 5 years ago
parent
commit
61e3f704c4
  1. 8
      app/Constants/v3/ErrorCode.php
  2. 2
      app/Controller/v3/OrderOnlineController.php
  3. 7
      app/Controller/v3/StoreController.php
  4. 3
      app/Model/v3/Coupon.php
  5. 4
      app/Service/v3/Implementations/UserAddressService.php
  6. 14
      app/Service/v3/Implementations/UserCenterBlockService.php

8
app/Constants/v3/ErrorCode.php

@ -347,5 +347,11 @@ class ErrorCode extends AbstractConstants
* 超出配送范围
* @Message("您的地址超出配送范围,请重新选择地址")
*/
const LOCATION_LONG_DISTANCE= 1302;
const LOCATION_LONG_DISTANCE = 1302;
/**
* 超出配送范围
* @Message("获取收货地址失败")
*/
const LOCATION_USER_ADDRESS = 1303;
}

2
app/Controller/v3/OrderOnlineController.php

@ -107,7 +107,7 @@ class OrderOnlineController extends BaseController
$distance = $this->locationService->getDistanceByTencent($market->lng,$market->lat,$address->lng,$address->lat);
}
if(isset($distance) && $distance > 8000){
if(isset($distance) && $distance < 8000){
$distributionPrice = $this->distributionPriceService->do($distance);
$res['location'] = [
'address' => $address,

7
app/Controller/v3/StoreController.php

@ -54,6 +54,13 @@ class StoreController extends BaseController
$data = $this->storeService->detail($params['store_id']);
$data['is_collected'] = (bool)$this->collectService->check($params['user_id'],$params['store_id']);
$data['goods_types'] = $this->categoryService->allForStore($params['store_id']);
$data['in_business'] = $this->storeService->check($params['store_id']);
if($data['in_business'] === true)
{
$data['in_business_text'] = '营业中';
}else{
$data['in_business_text'] = '休息中';
}
return $this->success(['store' => $data]);
}

3
app/Model/v3/Coupon.php

@ -17,7 +17,8 @@ class Coupon extends Model
];
protected $casts = [
'activity_available' => 'array'
'activity_available' => 'array',
'tags' => 'array'
];
public function getFullAmountTextAttribute()

4
app/Service/v3/Implementations/UserAddressService.php

@ -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;

14
app/Service/v3/Implementations/UserCenterBlockService.php

@ -34,11 +34,11 @@ class UserCenterBlockService implements UserCenterBlockServiceInterface
'type' => 'user',
'title' => '常用功能',
'items' => [
['name' => '收货地址', 'icon' => $img_host . 'user_icons/user_addr.png', 'type' => 'page', 'path' => '/pages/address/userAddress/userAddress','command'=>'user_addr'],
['name' => '当面付订单查询', 'icon' => $img_host . 'user_icons/offline_orders.png', 'type' => 'page', 'path' => '/pages/facepay/facepay','command'=>'offline_orders'],
['name' => '在线客服', 'icon' => $img_host . 'user_icons/online_kf.png', 'type' => 'page', 'path' => '','command'=>'online_kf'],
['name' => '联系服务站', 'icon' => $img_host . 'user_icons/contact_fwz.png', 'type' => 'page', 'path' => '/pages/contactMarket/contactMarket','command'=>'contact_fwz'],
['name' => '关于懒族', 'icon' => $img_host . 'user_icons/about_lz.png', 'type' => 'page', 'path' => '/pages/aboutUs/aboutUs','command'=>'about'],
['name' => '收货地址', 'icon' => $img_host . 'user_icons/user_addr2.png', 'type' => 'page', 'path' => '/pages/address/userAddress/userAddress','command'=>'user_addr'],
['name' => '当面付订单查询', 'icon' => $img_host . 'user_icons/offline_orders2.png', 'type' => 'page', 'path' => '/pages/facepay/facepay','command'=>'offline_orders'],
['name' => '在线客服', 'icon' => $img_host . 'user_icons/online_kf2.png', 'type' => 'page', 'path' => '','command'=>'online_kf'],
['name' => '联系服务站', 'icon' => $img_host . 'user_icons/contact_fwz2.png', 'type' => 'page', 'path' => '/pages/contactMarket/contactMarket','command'=>'contact_fwz'],
['name' => '关于懒族', 'icon' => $img_host . 'user_icons/about_lz2.png', 'type' => 'page', 'path' => '/pages/aboutUs/aboutUs','command'=>'about'],
]
]
];
@ -47,7 +47,7 @@ class UserCenterBlockService implements UserCenterBlockServiceInterface
'type' => 'store_user',
'title' => '商家相关',
'items' => [
['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login']
['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter2.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login']
]
];
@ -69,7 +69,7 @@ class UserCenterBlockService implements UserCenterBlockServiceInterface
'type' => 'sp_user',
'title' => '服务专员',
'items' => [
['name' => '评价', 'icon' => $img_host . 'user_icons/shop_enter.png', 'type' => 'page', 'path' => '/zh_cjdianc/pages/appraise/index?service_personnel_id='.$item['data']['id'],'command'=>'sp_login']
['name' => '评价', 'icon' => $img_host . 'user_icons/service2.png', 'type' => 'page', 'path' => '/zh_cjdianc/pages/appraise/index?service_personnel_id='.$item['data']['id'],'command'=>'sp_login']
]
];
}

Loading…
Cancel
Save