这里的实现代码是EasyWeChat3.0版,具体实现代码
$wechat = WechatPlatform::get(['business_id' => 1]);
// config配置
$options=[
'app_id' => $wechat['app_id'],
'secret' => $wechat['app_secret'],
'aes_key' => $wechat['wx_aeskey'],
'token' => $wechat['wx_token'],
];
$app = new Application($options);
$user = $app->user->get('6666R5mfR4GftZBpzzoI9n2gWGtE');
关注后会正常返回当前微信信息
没有关注返回的信息
所以我们只需要判断$user['subscribe']为0表示未关注,为1表示已关注
相关文章