|
@@ -105,6 +105,32 @@ class SubscribeController extends BaseController
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //只获取用户的强关二维码
|
|
|
|
+ protected function getSimpleRcodeInfo($appid)
|
|
|
|
+ {
|
|
|
|
+ $param_need = [
|
|
|
|
+ 'gzh_app_id' => $appid,
|
|
|
|
+ 'scene_id' => $this->uid,
|
|
|
|
+ 'timestamp' => time(),
|
|
|
|
+ ];
|
|
|
|
+ $param_need['sign'] = $this->getSign($param_need);
|
|
|
|
+ $client = new Client(['timeout' => 3.0,]);
|
|
|
|
+ try {
|
|
|
|
+ $qrcode_url_res = $client->request('get', 'https://zsyauth.aizhuishu.com/api/get_qrcode_url?' . http_build_query($param_need))->getBody()->getContents();
|
|
|
|
+ if ($qrcode_url_res) {
|
|
|
|
+ $qrcode_url = json_decode($qrcode_url_res, true);
|
|
|
|
+ if ($qrcode_url['code'] == 1) {
|
|
|
|
+ if (isset($qrcode_url['data']) && !empty($qrcode_url['data'])) {
|
|
|
|
+ return $qrcode_url['data'];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
//获取用户的强关信息
|
|
//获取用户的强关信息
|
|
function getFromUser()
|
|
function getFromUser()
|
|
{
|
|
{
|
|
@@ -125,6 +151,14 @@ class SubscribeController extends BaseController
|
|
}
|
|
}
|
|
$title = $official_account->nickname;
|
|
$title = $official_account->nickname;
|
|
$img = 'https://open.weixin.qq.com/qr/code?username='.$official_account->name;
|
|
$img = 'https://open.weixin.qq.com/qr/code?username='.$official_account->name;
|
|
|
|
+ if(isset($_GET['d']))
|
|
|
|
+ {
|
|
|
|
+ $qrcode_url = $this->getSimpleRcodeInfo($appid);dump($qrcode_url);
|
|
|
|
+ }
|
|
|
|
+ if($qrcode_url = $this->getSimpleRcodeInfo($appid))//用服务号强关二维码
|
|
|
|
+ {
|
|
|
|
+ $img = $qrcode_url;
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
return redirect()->to('/recent');
|
|
return redirect()->to('/recent');
|
|
}
|
|
}
|
|
@@ -139,4 +173,5 @@ class SubscribeController extends BaseController
|
|
|
|
|
|
return view('wap.userSubInfo',compact('head_img','img','title'));
|
|
return view('wap.userSubInfo',compact('head_img','img','title'));
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|