{
"begin_date": "2014-12-02",
"end_date": "2014-12-07"
}
API_DATA_CUBE_URL = 'https://api.weixin.qq.com/datacube', API_TYPE_DATA = 'datacube'
public function call($api_name, $params = array(), $type = self::GET, $api_type = self::API_TYPE_CGI) {
//加入datacube后,用switch来组接口URL
switch(true) {
case $api_type == self::API_TYPE_PAY :
$url = self::PAY_URL.$api_name;
break;
case $api_type == self::API_TYPE_DATA:
$url = self::API_DATA_CUBE_URL.$api_name;
break;
default :
$url = self::API_URL_PREFIX.$api_name;
}
if (in_array($api_name, self::$_no_need_token_apis)) {
$res = $this->request($url, $params, $type);
if ($res) {
return $res;
}
}
$this->_access_token = $this->getAccessToken();
if ($this->_access_token) {
//加多个or判断带上access_token
if ($type == self::JSON || $api_type == self::API_TYPE_DATA) {
$url = $url.'?access_token='.$this->_access_token;
} else {
$params['access_token'] = $this->_access_token;
}
$res = $this->request($url, $params, $type);
if ($res) {
return $res;
}
}
return false;
}
if (isset($argc) && $argc >= 1 && $argv[0] == __FILE__) {
$client = new WechatJSON(array(
WechatJSON::APP_ID => 'wx78sfsd023744d51',
WechatJSON::APP_SECRET => '9ba3476db1fsfsff512esf2f630fb9',
));
$res = $client->call('/getinterfacesummary', array(
'begin_date' => '2014-12-01',
'end_date' => '2014-12-31'
), WechatJSON::POST, WechatJSON::API_TYPE_DATA);
if (!$res) {
var_dump($client->_error);
}
var_dump($res);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有