//step2:生成二维码
//
$tmp_s_str = S('qr_str_' . $id);
if (empty($tmp_s_str)) {
Vendor('phpqrcode.phpqrcode');
$tmp_url = $this->WWW_DOMAIN . '?type=5&id=' . $id . '&driverType=4';
//打开缓冲区
ob_start();
//图片流存入缓冲区
\QRcode::png($tmp_url, false, QR_ECLEVEL_H, 4, 4);
$img_str = base64_encode(ob_get_contents());
S('qr_str_' . $id, $img_str, 0); //永久缓存
//关闭缓冲区
ob_end_clean();
} else {
$img_str = $tmp_s_str;
}