public function get_user_group($open_id)
{
$url = self::API_DOMAIN . 'cgi-bin/groups/getid?access_token=' . $this->get_access_token();
$xml = sprintf('{"openid":"%s"}', $open_id);
$res = HttpCurl::post($url, $xml, 'json');
// 异常处理: 获取时网络错误
if ($res === false) {
return Error::code('ERR_POST');
}
// 判断是否调用成功
if (isset($res->groupid)) {
return array(null, $res);
} else {
return array($res, null);
}
}