function getQrCode(){
//获取ticket
$access_token=$this->getWxAccessToken();
$url='https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token='.$access_token;
//{"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}
$postArr=array(
'action_name'=>'604800',//24*60*60*7 7天时间
'action_name'=>'QR_LIMIT_SCENE',
'action_info'=>array(
'scene'=>array('scene_id'=>2000),
),
);
$postJson=json_encode($postArr);
$res=$this->http_curl($url,'post','json',$postJson);
$ticket=$res['ticket'];
$url="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".urlencode($ticket);
echo "<img src='".$url."'/>";
}
临时二维码的action_name=QR_SCENE
QR_LIMIT_SCENE是永久二维码