public function query($param){
//$out_detail_no='lc'.$param;
$url = 'https://api.mch.weixin.qq.com/v3/transfer/batches/batch-id/'.$param.'?need_query_detail=true&detail_status=ALL&offset=0&limit=20';
// $url = 'https://api.mch.weixin.qq.com/v3/transfer/batches/out-batch-no/'.$param.'/details/out-detail-no/'.$out_detail_no;
// $url = 'https://api.mch.weixin.qq.com/v3/transfer/batches/out-batch-no/'.$param.'?need_query_detail=true&detail_status=All';
// $urls=urlencode($url);
// echo $urls;
//echo "<br>";
$pars = [];
// $pars['appid'] = $this->appid;//直连商户的appid
$token = $this->getToken($pars);//获取token
// var_dump($token);
$res = $this->curlGet($url,json_encode($pars),$token);//发送请求
return $res;
}
function curlGet($url , $data = null,$token)
{
$ch= curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 500);
if (!empty($data)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$headers = [
'Authorization:WECHATPAY2-SHA256-RSA2048 '.$token,
'Accept: application/json',
'Content-Type: application/json; charset=utf-8',
'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
];
if(!empty($headers)){
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
查询内容为空!