请求服务器jsapi_ticket
@param string $type
@return array
964845
protected function requestJsApiTicket($type = 'jsapi')
    {
        $result = $this->httpGet(static::WECHAT_JS_API_TICKET_URL, [
            'access_token' => $this->getAccessToken(),
            'type' => $type
        ]);
        if (isset($result['ticket'])) {
            $result['expire'] = $result['expires_in'] + (int)YII_BEGIN_TIME;
            return $result;
        }
        return false;
    }
1236780
public static function getRequestParams($type = 'all')
    {
        $request = Yii::$app->getRequest();
        switch ($type) {
            case 'get':
                $params = $request->get();
                break;

            case 'post':
                $params = $request->post();
                break;

            case 'all':
            default:
                $params = ArrayHelper::merge($request->get(), $request->post());
                break;
        }

        return $params;
    }
1356535
private function getJsApiTicket() {
        $key  = md5(__FILE__ . 'jsapi_ticket');
        $data = to_array(cache::get($key));
        if (!cache::check($key) || $data['expire_time'] < time()) {
            $accessToken = $this->getAccessToken();
            #提交URL地址
            $url  = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=$accessToken";
            $res  = to_array($this->httpGet($url));
            $data = array();
            #返回Ticket信息
            $ticket = $res['ticket'];
            if ($ticket) {
                $data['expire_time']  = time() + 7000;
                $data['jsapi_ticket'] = $ticket;
                cache::set($key, to_json($data), 7000);
            }
        } else {
            $ticket = $data['jsapi_ticket'];
        }
        return $ticket;
    }
1198522
public function guessEventPieces($type)
    {
        /*
         * Guess the event kind.
         *
         * In an event like charge.dispute.closed, the kind is "charge".
         */
        $dotPosition = strpos($type, '.');
        $eventKind   = substr($type, 0, $dotPosition);

        /*
         * Guess the constant of the type.
         *
         * In an event like charge.dispute.closed, the type is "DISPUTE_CLOSED".
         */
        $string    = str_replace($eventKind . '.', '', $type);
        $string    = str_replace('.', '_', $string);
        $eventType = strtoupper($string);

        return [
            'kind' => $eventKind,
            'type' => $eventType,
        ];
    }
867339
protected function getAllowedFields(string $type): array
    {
        \assert($this->hasFilter($type) === true);

        return $this->fieldSets[$type];
    }
1209511
public function getPage4Type($type)
    {
        $cachingKey = Caching::PAGE_INFO . '_' . $type;

        $pageInfo = $this->cachingHelperService->getItem($cachingKey, function () use ($type) {
            /** @var \PServerCore\Entity\Repository\PageInfo $repository */
            $repository = $this->entityManager->getRepository(
                $this->collectionOptions->getEntityOptions()->getPageInfo()
            );
            return $repository->getPageData4Type($type);
        });

        return $pageInfo;
    }
191907
public function delTicket($type = 'jsapi', $appid = null)
    {
        is_null($appid) && $appid = $this->config->get('appid');
        $cache_name = "{$appid}_ticket_{$type}";
        Tools::delCache($cache_name);
    }
1364676
static public function end($type = 'app')
    {
        if (!isset(self::$_timeStore[$type])) {
            throw new Exception(str_cover('没有"{type}"对应的 timer', [
                '{type}' => $type,
            ]));
        }
        $e = self::microTime(false);
        $s = self::$_timeStore[$type];
        unset(self::$_timeStore[$type]);
        return sprintf('%.6f', $e - $s);
    }
797679
public static function getFilter(string $type): array
    {
        return isset(self::$filters[$type]) ? self::$filters[$type] : [];
    }
999875
public function getNavTypes($type, $types)
    {
        if ($type === null) {
            return $types;
        }

        return $this->filterTypes($types, $this->getTypeCategory($type));
    }
1306494
public function lists($type = null)
    {
        $params = [
            'type' => $type,
        ];

        return $this->parseJSON('get', [self::API_LISTS, $params]);
    }
907205
public static Ticket ticketGetticket(String access_token,String type){
		HttpUriRequest httpUriRequest = RequestBuilder.get()
				.setUri(BASE_URI + "/cgi-bin/ticket/getticket")
				.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
				.addParameter("type", type)
				.build();
		return LocalHttpClient.executeJsonResult(httpUriRequest,Ticket.class);
	}
446312
public function get($type)
    {
        $sum = 0;
        $now = $this->getTimeInMilliseconds();

        for ($i = 0; $i < $this->rollingStatisticalWindowBuckets; $i++) {
            $bucketIndex = $this->getBucketIndex($i, $now);
            $sum += $this->stateStorage->getBucket($this->commandKey, $type, $bucketIndex);
        }

        return $sum;
    }
1367688
public function ticket($forceRefresh = false)
    {
        $cacheKey = [__CLASS__, 'appId' => Yii::$app->wechat->appId];
        if ($forceRefresh || ($ticket = Yii::$app->wechat->cache->get($cacheKey)) === false) {
            $response = $this->post(self::API_TICKET, ['type' => 'jsapi']);
            Yii::$app->wechat->cache->set($cacheKey, $response['ticket'], $response['expires_in'] - 500);
            return $response['ticket'];
        }
        return $ticket;
    }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
16365
public function nextval($type = null) {
		$result = $this->getByType('nextval');
		if (!empty($type)) {
			return $result[$type];
		}
		return $result;
	}
1202323
public static function getTypeName($type = null)
    {
        $result = [
            Item::TYPE_PERMISSION => 'Permission',
            Item::TYPE_ROLE => 'Role',
        ];
        if ($type === null) {
            return $result;
        }

        return $result[$type];
    }