vendor('phpqrcode');
$value = 'https://www.baidu.com ';
$errorCorrectionLevel = 'L';
$matrixPointSize = 5;
if(!is_dir("qrcode")){
mkdir("qrcode");
}
$filename = 'qrcode/'.time().rand(10000,9999999).'.png';
\QRcode::png($value,$filename , $errorCorrectionLevel, $matrixPointSize, 2);
$request = Request::instance();
$domain = $request->domain();
$img = $domain.'/'.$filename;
$data = [
'qr_code' => $img,
'mobile' => $mobile
];
$ins = $model->er_ins($data,$mobile);
return json_encode(['data'=>$ins,'code'=>200]);
转载请注明原文地址:https://ipadbbs.8miu.com/read-24858.html