获取用户列表.

@param string|null $nextOpenId

@return mixed

@see   https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
540388
public function getUsersList(string $nextOpenId = null)
    {
        return $this->curl->get(self::GET_USER_LIST.$this->access_token.'&'.http_build_query([
                    'next_openid' => $nextOpenId,
                ]
            ));
    }
315960
public static function get(string $token, string $openID = null, bool $echostr = false, bool $returnArray = false)
    {
        $nonce = 'test';
        $timestamp = time();

        $array = [$nonce, $timestamp, $token];
        sort($array, SORT_STRING);
        $signature = sha1(implode('', $array));
        $data = [
            'signature' => $signature,
            'timestamp' => $timestamp,
            'nonce' => $nonce,
            'openid' => $openID,
            'echostr' => $echostr ? 'echostr' : null,
        ];

        if ($returnArray) {
            return $data;
        }

        return '?'.http_build_query($data);
    }
1353137
public function get(string $beginOpenId = null)
    {
        return $this->curl->post(self::GET.$this->access_token, json_encode([
                'begin_openid' => $beginOpenId,
            ]
        ));
    }
394886
public function nextChild($id)
    {
        $child = $this->getChild($id);
        $next  = $this->children[$child->id()]['next'];

        return $this->getChild($next);
    }
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;
    }
986771
public function handle($request, Closure $next)
    {
        $headers = [
            'Request-Limit' => $this->ipLimit($request)->getLimit(),
            'Request-Limit-Expire-Data' => $this->ipLimit($request)->getExpireDate(),
            'Request-Already' => $this->ipLimit($request)->getLimit() - $this->ipLimit($request)->getCount()
        ];
        if ($this->ipLimit($request)->hasTooManyAttempts($request)) {
            /*return response([
                'data' => '访问次数限制!',
                'code' => 429,
                'status_code' => 429,
            ],429, $headers);*/
			return response('访问次数限制!',429, $headers);
        }
        return $next($request);
    }
590742
public function openWebById($webId)
    {
        $web = new Web($this->getContext(),$this->getResourcePath());
        $qry = new InvokePostMethodQuery($this->getResourcePath(),"openWebById",array($webId));
        $this->getContext()->addQuery($qry,$web);
        return $web;
    }
782829
public static function postId(RuleInterface $next = null): RuleInterface
    {
        return self::stringToInt(self::readable(postsApi::class, $next));
    }
982576
public function read( $id, $next ) {
		$data = $this->_read( $id );
		if ( false === $data ) {
			$data = $next( $id );
			if ( false !== $data ) {
				$this->_write( $id, $data );
			}
		}

		return $data;
	}
994618
public function handle($request, Closure $next)
    {
        try {
            return $next($request);
        } catch(Exception $exception){
            $code =$exception->getCode();

            if($code< 100 || $code >= 600){
                $code = 512;  //运行时异常
            }

            $errors = ['msg'=>$exception->getMessage(), 'code'=>$code];
            if ($request->ajax() || $request->wantsJson()) { //输出 JSON 字符串
                return new JsonResponse($errors, $code);
            }

            //输出异常信息， 跳转回 GET 页
            \Html::error($exception->getMessage(), $code);

            return redirect()->back()
                ->withInput($request->input())
                ->withErrors($errors, $exception->getMessage());
        }
    }
1279554
public function getLink($languageId = null)
    {
        return $this->_addPageNrParam($this->getBaseLink($languageId), $this->getActPage(), $languageId);
    }
1319148
public GetUsersResponse getUsers(String nextOpenid) {
        GetUsersResponse response;
        LOG.debug("获取关注者列表.....");
        String url = BASE_API_URL + "cgi-bin/user/get?access_token=#";
        if (StrUtil.isNotBlank(nextOpenid)) {
            url += "&next_openid=" + nextOpenid;
        }
        BaseResponse r = executeGet(url);
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, GetUsersResponse.class);
        return response;
    }
747891
function getIncreaseId($appKey, $init_id = 1)
    {
        if (empty($appKey))
        {
            return false;
        }
        $main_key = self::$prefix . $appKey;
        //已存在 就加1
        if ($this->_redis->exists($main_key))
        {
            $inc = $this->_redis->incr($main_key);
            if (empty($inc))
            {
                \Swoole::$php->log->put("redis::incr() failed. Error: ".$this->_redis->getLastError());
                return false;
            }
            return $inc;
        }
        //上面的if条件返回false,可能是有错误，或者key不存在，这里要判断下
        else if($this->_redis->getLastError())
        {
            return false;
        }
        //这才是说明key不存在，需要初始化
        else
        {
            $init = $this->_redis->set($main_key, $init_id);
            if ($init == false)
            {
                \Swoole::$php->log->put("redis::set() failed. Error: ".$this->_redis->getLastError());
                return false;
            }
            else
            {
                return $init_id;
            }
        }
    }
868685
public function createPermanentQrCode($sceneId)
    {
        return $this->auth(function () use ($sceneId) {
            if (filter_var($sceneId, FILTER_VALIDATE_INT) && $sceneId > 0 && $sceneId <= 100000) {
                // 正整数
                $data = [
                    'action_name' => 'QR_LIMIT_SCENE',
                    'action_info' => [
                        'scene' => [
                            'scene_id' => $sceneId,
                        ],
                    ],
                ];
            } else {
                // 字符串
                $data = [
                    'action_name' => 'QR_LIMIT_STR_SCENE',
                    'action_info' => [
                        'scene' => [
                            'scene_str' => $sceneId,
                        ],
                    ],
                ];
            }

            return $this->http->postJson(
                $this->baseUrl . 'cgi-bin/qrcode/create?access_token=' . $this->accessToken,
                json_encode($data)
            );
        });
    }
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);
    }
644845
public function getMemberList($nextOpenId = null)
    {
        $nextOpenId === null && $nextOpenId = ['next_openid' => $nextOpenId];
        $result = $this->httpGet(self::WECHAT_MEMBER_GET_URL . 'access_token=' . $this->getAccessToken(), $nextOpenId);
        return !isset($result['errcode']) ? $result : false;
    }
1143265
public function find($id, $lockMode = null, $lockVersion = null)
    {
        $qb = $this->createQueryBuilder('n');

        if (preg_match('/^\d+$/', $id)) {
            $qb->where('n.id = :id');
        } else {
            $qb->where('n.uuid = :id');
        }

        return $qb
            ->getQuery()
            ->setParameter('id', $id)
            ->getOneOrNullResult();
    }