<?php
/**
 * 二维码
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author lss <lss@qq.com>
 */
namespace Home\Controller;
class QrcodeController extends BaseController {
    public function index(){
        return phpgrcode();
    }
    public function wxqrcode(){
        $id=I('id');
        $type=I('type');
        $sp=I('sp',0,'intval');
        if(empty($id))return;
                
        $result=wxqrcode($id,$type,$sp);
        if(empty($result['status']) || !empty($type)){echo $result['info'];exit;}        
        if(empty($type)){
            header("Content-Type:image/jpg");
            if(str_exists($result['info'],'http'))echo file_get_contents($result['info']);
            else echo $result['info'];
        }
    }
    public function testqr(){
        $id=I('id',1,'intval');$size='';
        $member_info['username']='Good Good Study';
         $length= checkStrlength($member_info['username'],$size);;
        echo $length;
        $result=tgercode($id,2,2);
        print_r($result);
    }
}