充值券点接口
@param integer $coin_count
@return array
@throws Exceptions\InvalidResponseException
@throws Exceptions\LocalCacheException
762446
public function payRecharge($coin_count)
    {
        $url = "https://api.weixin.qq.com/card/pay/recharge?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['coin_count' => $coin_count]);
    }
1348263
function count()
    {
        $count = isset($this->cache['count']) ? $this->cache['count'] : $this->_count();

        return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
    }
1283339
public function getBalance($user_id, $type = -1){
        $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS_BALANCE;
        $url = sprintf($url, $user_id, $type);
        $result = $this->authenticationService->getTransport()->fetch($url);

        if($result["code"] == APIResponse::RESPONSE_SUCCESS){
            return $result['results'];
        }else{
            return 0;
        }
    }
1328971
public function listDiscounts($location_id)
    {
        list($response, $statusCode, $httpHeader) = $this->listDiscountsWithHttpInfo ($location_id);
        return $response; 
    }
44253
protected function combineBalances($api_call_result)
    {
        $balance_map = [];
        foreach ($api_call_result['unconfirmedBalances'] as $entry) {
            $balance_map[$entry['asset']] = [
                'unconfirmed' => $this->buildQuantityObject($entry['quantity']),
                'confirmed' => CryptoQuantity::fromSatoshis('0'),
            ];
        }
        foreach ($api_call_result['confirmedBalances'] as $entry) {
            $balance_map[$entry['asset']]['confirmed'] = $this->buildQuantityObject($entry['quantity']);
        }

        $combined_output = [];
        foreach ($balance_map as $asset => $entry) {
            $combined_output[$asset] = $entry + [
                'asset' => $asset,
            ];
        }

        return $combined_output;
    }
643815
function dm_user_list( $count = 20, $cursor = 0)
	{
		$params = array();
		$params['count'] = $count;
		$params['cursor'] = $cursor;
		return $this->oauth->get( 'direct_messages/user_list', $params );
	}
922509
public function queryAccountPoint()
    {
        $request = $this->client->newRequest(
            'GET',
            $this->client->buildUriWithQuery('/SmQueryGet.asp')
        );

        $response = $this->client->sendRequest($request);
        $contents = $response->getBody()->getContents();
        $data = explode("=", $contents);

        return $data[1];
    }
96495
public function getForeverCount(){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::MEDIA_FOREVER_COUNT_URL.'access_token='.$this->access_token);
        if ($result)
        {
            $json = json_decode($result,true);
            if (isset($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
662307
public function getToken()
    {
        $this->token = Cache::get($this->cacheKey);

        // 从缓存中获取不到token或设置了强制刷新
        if (!$this->token || $this->force) {
            $params = array(
                'component_appid'         => Config::get('wechat.componentAppId'),
                'component_appsecret'     => Config::get('wechat.componentAppSecret'),
                'component_verify_ticket' => ComponentVerifyTicket::getTicket(),
            );

            $http = new ComponentHttp();
            $response = $http->jsonPost(self::API_COMPONENT_TOKEN, $params);

            // 设置token
            $this->token = $response['component_access_token'];

            // 把token缓存起来
            $expiresAt = Carbon::now()->addSeconds($response['expires_in']);
            Cache::put($this->cacheKey, $this->token, $expiresAt);
        }

        return $this->token;
    }
762253
public function getBatchCards($offset = 0, $count = 50)
    {
        $result = $this->httpPost(static::WECHAT_GET_BATCH_CARD_URL . 'access_token=' . $this->getAccessToken(), [
            'offset' => $offset,
            'count' => $count
        ]);

        return isset($result['card_id_list']) ? $result['card_id_list'] : false;
    }
83685
public function lists($offset = 0, $count = 10, $statusList = 'CARD_STATUS_VERIFY_OK')
    {
        $params = [
            'offset'      => $offset,
            'count'       => $count,
            'status_list' => $statusList,
        ];

        return $this->parseJSON('json', [self::API_LIST_CARD, $params]);
    }
758062
public function get_material_count()
    {
        $url = self::API_DOMAIN . 'cgi-bin/material/get_materialcount?access_token=' . $this->get_access_token();
        $res = HttpCurl::get($url, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_GET');
        }
        // 判断是否调用成功
        if (!property_exists($res, 'errcode')) {
            return array(null, $res);
        } else {
            return array($res, null);
        }
    }
379895
public function GetCommentCounts() {
      $this->AllowJSONP(TRUE);
      
		$vanilla_identifier = GetValue('vanilla_identifier', $_GET);
		if (!is_array($vanilla_identifier))
			$vanilla_identifier = array($vanilla_identifier);
         
      $vanilla_identifier = array_unique($vanilla_identifier);
      
      $FinalData = array_fill_keys($vanilla_identifier, 0);
      $Misses = array();
      $CacheKey = 'embed.comments.count.%s';
      $OriginalIDs = array();
      foreach ($vanilla_identifier as $ForeignID) {
         $HashedForeignID = ForeignIDHash($ForeignID);
         
         // Keep record of non-hashed identifiers for the reply
         $OriginalIDs[$HashedForeignID] = $ForeignID;
         
         $RealCacheKey = sprintf($CacheKey, $HashedForeignID);
         $Comments = Gdn::Cache()->Get($RealCacheKey);
         if ($Comments !== Gdn_Cache::CACHEOP_FAILURE)
            $FinalData[$ForeignID] = $Comments;
         else
            $Misses[] = $HashedForeignID;
      }
      
      if (sizeof($Misses)) {
         $CountData = Gdn::SQL()
            ->Select('ForeignID, CountComments')
            ->From('Discussion')
            ->Where('Type', 'page')
            ->WhereIn('ForeignID', $Misses)
            ->Get()->ResultArray();
         
         foreach ($CountData as $Row) {
            // Get original identifier to send back
            $ForeignID = $OriginalIDs[$Row['ForeignID']];
            $FinalData[$ForeignID] = $Row['CountComments'];
            
            // Cache using the hashed identifier
            $RealCacheKey = sprintf($CacheKey, $Row['ForeignID']);
            Gdn::Cache()->Store($RealCacheKey, $Row['CountComments'], array(
               Gdn_Cache::FEATURE_EXPIRY     => 60
            ));
         }         
      }
      
		$this->SetData('CountData', $FinalData);
		$this->DeliveryMethod = DELIVERY_METHOD_JSON;
		$this->DeliveryType = DELIVERY_TYPE_DATA;
		$this->Render();
	}
848135
public function fetchUserCount($username, $show_group)
    {
        // Fetch user count
        $num_users = DB::forTable('users')
            ->tableAlias('u')
            ->whereGt('u.id', 1)
            ->whereNotEqual('u.group_id', ForumEnv::get('FEATHER_UNVERIFIED'));

        if ($username != '') {
            $num_users = $num_users->whereLike('u.username', str_replace('*', '%', $username));
        }
        if ($show_group > -1) {
            $num_users = $num_users->where('u.group_id', $show_group);
        }

        $num_users = $num_users->count('id');

        $num_users = Container::get('hooks')->fire('model.userlist.fetch_user_count', $num_users);

        return $num_users;
    }
728772
public function getCoinsInfo()
    {
        $url = "https://api.weixin.qq.com/card/pay/getcoinsinfo?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }
296123
public function checkToken($request_token)
    {
        $token_manager = $this->container->get('security.csrf.token_manager');
        $token = new CsrfToken('file_manager', $request_token);
        $valid = $token_manager->isTokenValid($token);

        if (!$valid) {
            throw new InvalidCsrfTokenException();
        }
    }
908656
public static function count(/* ... */)
	{
		$args = func_get_args();
		$options = static::extractAndValidateOptions($args);
		$options['select'] = 'COUNT(*)';

		if (!empty($args) && !is_null($args[0]) && !empty($args[0]))
		{
			if (is_hash($args[0]))
				$options['conditions'] = $args[0];
			else
				$options['conditions'] = call_user_func_array('static::pk_conditions',$args);
		}

		$table = static::table();
		$sql = $table->options_to_sql($options);
		$values = $sql->get_where_values();
		return static::connection()->query_and_fetch_one($sql->to_s(),$values);
	}