|
|
@@ -72,22 +72,22 @@ Class AuthService{
|
|
|
|
|
|
public function didiAuth($mainId, $shopId)
|
|
|
{
|
|
|
- // $shop = ShopClass::getById($shopId, false, 'id,lat,long');
|
|
|
- // if(!$shop){
|
|
|
- // util::fail('门店不存在');
|
|
|
- // }
|
|
|
- // $lat = $shop['lat'];
|
|
|
- // $lng = $shop['long'];
|
|
|
- // if(empty($lat) || empty($lng)){
|
|
|
- // util::fail('门店经纬度不存在');
|
|
|
- // }
|
|
|
+ $shop = ShopClass::getById($shopId, false, 'id,lat,long');
|
|
|
+ if(!$shop){
|
|
|
+ util::fail('门店不存在');
|
|
|
+ }
|
|
|
+ $lat = $shop['lat'];
|
|
|
+ $lng = $shop['long'];
|
|
|
+ if(empty($lat) || empty($lng)){
|
|
|
+ util::fail('门店经纬度不存在');
|
|
|
+ }
|
|
|
+
|
|
|
$didiAuth = new \common\components\delivery\platform\didi\Auth();
|
|
|
- $ret = $didiAuth->getAuthUrl($mainId, 110100, '', '');
|
|
|
+ $ret = $didiAuth->getAuthUrl($mainId, '', $lat, $lng);
|
|
|
if(isset($ret['raw']) && $ret['raw']['code'] == 200){
|
|
|
util::success(['url'=>$ret['raw']['data']['authUrl']]);
|
|
|
}else{
|
|
|
util::fail('获取授权地址失败');
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|