params['ghsHost']; // TODO 暂时修改为测试环境 $apiHost = 'https://api.shop.hzghd.com'; } else { $apiHost = Yii::$app->params['ghsHost']; } $redirectUrl = $apiHost . '/delivery/shansong-auth-callback'; $authUrl = $auth->generateMerchantAuthUrl($mainId, $redirectUrl); // 重定向用户 //header('Location: ' . $authUrl); util::success(['url'=>$authUrl]); } public function huolalaAuth($mainId) { $huoLalaAuth = new \common\components\delivery\platform\huolala\Auth(); // $apiHost = Yii::$app->params['ghsHost']; // TODO 暂时修改为测试环境 $apiHost = 'https://api.shop.hzghd.com'; $redirectUrl = $apiHost . '/delivery/huolala-auth-callback' . '?mainId=' . $mainId; $authUrl = $huoLalaAuth->generateAuthUrl($redirectUrl); //header('Location: ' . $authUrl); util::success(['url'=>$authUrl]); } public function fengniaoAuth($mainId) { $fengnaioAuth = new \common\components\delivery\platform\fengniao\Auth(); // $apiHost = Yii::$app->params['ghsHost']; // TODO 暂时修改为测试环境 $apiHost = 'https://api.shop.hzghd.com'; $redirectUrl = $apiHost . '/delivery/fengniao-auth-callback' . '?main_id=' . $mainId; $authUrl = $fengnaioAuth->generateAuthUrl($redirectUrl); util::success(['url'=>$authUrl]); } public function dadaAuth($mainId) { $dadaAuth = new \common\components\delivery\platform\dada\Auth(); $ticket = $dadaAuth->getTicket(); $redirectUrl = Yii::$app->params['ghsHost'] . '/delivery/dada-auth-callback' . '?mainId=' . $mainId; $shopNumber = '40d8391f9b05477b'; $state = 'huidiao_biaoshi'; $authUrl = $dadaAuth->generateAuthUrl($ticket, $state, $shopNumber); //header('Location: ' . $authUrl); util::success(['url'=>$authUrl]); } public function shunfengAuth($mainId) { $shunfengAuth = new \common\components\delivery\platform\shunfeng\Auth(); $authUrl = $shunfengAuth->generateAuthUrl($mainId); util::success(['url'=>$authUrl]); } 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('门店经纬度不存在'); // } $didiAuth = new \common\components\delivery\platform\didi\Auth(); $authUrl = $didiAuth->getAuthUrl($mainId, 110100, '', ''); util::success(['url'=>$authUrl]); } }