获取用户基本信息.

@param string $openId
@param string $lang

@return mixed

@see   https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
184159
public function getUserInfo(string $openId, string $lang = 'zh_CN')
    {
        return $this->curl->get(self::GET.$this->access_token.'&'.http_build_query([
                    'openid' => $openId,
                    'lang' => $lang,
                ]
            ));
    }
1148886
public static UserInfoList userInfoBatchget(String access_token,String lang,List<String> openids){
		return userInfoBatchget(access_token, lang, openids,0);
	}
61226
public static function getByOpenId($openid)
    {
        $u = self::getByResult(fssql_query('SELECT * FROM '.User::TABLE.' WHERE external='.USER_OPENID.' and external_id="'.$openid.'"'));
        if (!$u) {
            if (!$user['fullname']) $user['fullname'] = parse_url($openid, PHP_URL_HOST);
            fssql_query('INSERT INTO users (date_reg, email,login,name,disabled,external,external_id) VALUES (NOW(), "'.$user['email'].'","'.parse_url($openid, PHP_URL_HOST).'","'.$user['fullname'].'",0,'.USER_OPENID.',"'.$openid.'")');
            $u = self::getByResult(fssql_query('SELECT * FROM '.User::TABLE.' WHERE external='.USER_OPENID.' and external_id="'.$openid.'"'));
			$u->addExternal(USER_OPENID,$openid);
        }
        return $u;
    }
870021
public static function payMethods($lang = null)
    {

        try {
            $authType = self::getAuth();
        } catch (OpenPayU_Exception $e) {
            throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
        }

        if (!$authType instanceof AuthType_Oauth) {
            throw new OpenPayU_Exception_Configuration('Retrieve works only with OAuth');
        }

        $pathUrl = OpenPayU_Configuration::getServiceUrl() . self::PAYMETHODS_SERVICE;
        if ($lang !== null) {
            $pathUrl .= '?lang=' . $lang;
        }

        $response = self::verifyResponse(OpenPayU_Http::doGet($pathUrl, $authType));

        return $response;
    }
1264151
public String getGroupIdByOpenid(String openid) {
        BeanUtil.requireNonNull(openid, "openid is null");
        LOG.debug("通过关注者ID获取所在分组信息.....");
        String result = null;
        String url = BASE_API_URL + "cgi-bin/groups/getid?access_token=#";
        Map<String, String> params = new HashMap<String, String>();
        params.put("openid", openid);
        BaseResponse r = executePost(url, JSONUtil.toJson(params));
        if (isSuccess(r.getErrcode())) {
            result = JSONUtil.toMap(r.getErrmsg()).get("groupid").toString();
        }
        return result;
    }
433238
public function getLocaleByLangId($langId)
    {
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());

        // Sending service start event
        $arrayParameters = $this->sendEvent('melisengine_service_get_local_by_id_start', $arrayParameters);

        // Service implementation start
        $langTable = $this->getServiceLocator()->get('MelisEngineTableCmsLang');
        $result = $langTable->getEntryByField('lang_cms_id', $langId)->toArray();
        if(!isset($result[0]['lang_cms_locale'])) return null;
        $result = $result[0]['lang_cms_locale'];
        // Service implementation end

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $result;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melisengine_service_get_local_by_id_end', $arrayParameters);

        return $arrayParameters['results'];
    }
780472
public function typing($openid, $command = 'Typing')
    {
        $url = "https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['touser' => $openid, 'command' => $command]);
    }
50523
public function getKFSession($openid)
    {
        if (!$this->access_token && !$this->getAccessToken()) {
            return false;
        }
        $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET . "access_token={$this->access_token}" . '&openid=' . $openid);
        if ($result) {
            $json = json_decode($result, true);
            if (empty($json) || !empty($json['errcode'])) {
                $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505';
                $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解析接口返回内容！';
                return $this->checkRetry(__FUNCTION__, func_get_args());
            }
            return $json;
        }
        return false;
    }
720621
private function getUserInfo(string $access_token, string $open_id, string $language = 'zh_CN')
    {
        $data = [
            'access_token' => $access_token,
            'openid' => $open_id,
            'lang' => $language,
        ];
        $url = self::USER_INFO.http_build_query($data);

        return $this->curl->get($url);
    }
1089091
public function create_kf_session($openid, $kf_account, $text='')
    {
        $url = self::API_DOMAIN . 'customservice/kfsession/create?access_token=' . $this->get_access_token();
        $xml = sprintf('{'.
                    '"kf_account" : "%s",'.
                    '"openid" : "%s",'.
                    '"text" : "%s"}',
                    $kf_account,
                    $openid,
                    $text);
        $res = HttpCurl::post($url, $xml, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_GET');
        }
        // 判断是否调用成功
        if ($res->errcode == 0) {
            return array(null, true);
        } else {
            return array($res, null);
        }
    }
405571
public function getUsers(int $id, string $openId = null)
    {
        return self::$curl->get(self::TAG_USERS.self::$access_token, json_encode(array_filter([
                'tagid' => $id,
                'next_openid' => $openId,
            ]
        )));
    }
71678
public function delete($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Tags', 'delete')) {
            return $this->noPermission();
        }

        $tagDeleteRes = $this->deleteTag($id);
        if(gettype($tagDeleteRes) == "boolean") {
            if($tagDeleteRes) {
                return $this->response('Tag is successfully deleted');
            }
        }else{
            return $tagDeleteRes;
        }
        return $this->response('Tag could not be deleted. Please try again later or contact your Administrator!', 500);
    }
924199
public function detailsJSON($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'read')) {
            return $this->noPermission();
        }
        $postType = App\Models\PostType::find($id);

        $categories = [];
        if($postType) {
            // has access into all categories
            if(User::hasAccess($postType->slug, 'categories', 'hasAll')) {
                $categories = DB::table('categories')
                    ->join('post_type', 'post_type.postTypeID', 'categories.postTypeID')
                    ->where('post_type.slug', $postType->slug)
                    ->orderBy('name', 'postTypeID')
                    ->select(
                        'categories.categoryID', 'categories.title', 'categories.slug', 'categories.createdByUserID', 'categories.order', 'categories.featuredImageID',
                        'categories.description', 'categories.created_at', 'categories.updated_at', 'post_type.name'
                    )
                    ->get();
            }else if(User::getPermission($postType->slug, 'categories')) {
                // has access into some categories
                $allowedCategories = User::getPermission()[$postType]['categories']['value'];
                $categories = DB::table('categories')
                    ->join('post_type', 'post_type.postTypeID', 'categories.postTypeID')
                    ->where('post_type.slug', $postType->slug)
                    ->whereIn('categories.categoryID', $allowedCategories)
                    ->orderBy('name', 'postTypeID')
                    ->select(
                        'categories.categoryID', 'categories.categoryID', 'categories.slug', 'categories.createdByUserID', 'categories.order', 'categories.featuredImageID',
                        'categories.description', 'categories.created_at', 'categories.updated_at', 'post_type.name'
                    )
                    ->get();
            }
        }

        $categories = Language::filterRows($categories, false);

        $final = array('details' => $postType, 'categories' => $categories, 'dbTables' => $this->getTables());

        // Fire event
        $final['events'] = Event::fire('postType:pre_update', [$final]);

        return $final;
    }
1352551
public function delete($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'delete')) {
            return $this->noPermission();
        }

        $res = $this->deletePostType($id);
        if($res && is_bool($res)) {
            return $this->response('Post Type is successfully deleted');
        }
        if($res && !is_bool($res)) {
            return $res;
        }
        return $this->response('Post Type could not be deleted. Please try again later or contact your Administrator!', 500);
    }
968651
public static User userinfo(String access_token,String openid,String lang){
		return userinfo(access_token, openid, lang,0);
	}
1125879
public function getLanguage($userId, $optParams = array())
  {
    $params = array('userId' => $userId);
    $params = array_merge($params, $optParams);
    return $this->call('getLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
  }
912924
public List<User> batchGet(String... openIds) {
        if(openIds.length > 100) {
            throw new WxRuntimeException(999, "批量获取用户基本信息。最多支持一次拉取100条");
        }
        List<Map<String, String>> list = new ArrayList<>();
        for (String openId: openIds) {
            Map<String, String> map = new HashMap<>();
            map.put("openid", openId);
            map.put("lang", "zh_CN");
            list.add(map);
        }
        return batchGet(list);
    }