作者 王智

商家收款码

... ... @@ -186,6 +186,6 @@ class Common extends Api
*/
public function invite_images()
{
$this->delDirAndFile('images/');
$this->delDirAndFile('images2/');
}
}
... ...
... ... @@ -400,7 +400,28 @@ class Seller extends Api
*/
public function seller_code()
{
$param=$this->request->param();
$this->scerweima($url . '/' . $user_id['id']);
$param = $this->request->param();
$url = $param['url'];
$seller_id = $param['id'];
if (empty($url)) {
$this->error('参数不能为空!', '', '7');
}
function scerweima($url = '', $seller_id = '')
{
Vendor('phpqrcode.phpqrcode');
$errorCorrectionLevel = 'L'; //容错级别
$matrixPointSize = 10; //生成图片大小
//生成二维码图片
$path = "images2/";
$fileName = $path . 'seller_' . $seller_id . '.png';
$qr = new \QRcode();
$qr::png($url, $fileName, $errorCorrectionLevel, $matrixPointSize, 2);
}
scerweima($url . '/' . $seller_id, $seller_id);
$return = [
'url' => $url . '/' . 'images2/seller_' . $seller_id . '.png'
];
$this->success('成功', $return);
}
}
\ No newline at end of file
... ...
... ... @@ -341,24 +341,6 @@ class Api
/**
* 生成商家收款二维码
*/
function scerweima2($url = '')
{
Vendor('phpqrcode.phpqrcode');
$value = $url; //二维码内容
$errorCorrectionLevel = 'L'; //容错级别
$matrixPointSize = 7.5; //生成图片大小
$time = time();
//生成二维码图片
$path = "images2/";
$fileName = $path . $time . '.png';
$qr1 = new \QRcode();
$qr1::png($value, $fileName, $errorCorrectionLevel, $matrixPointSize, 2);
}
/**
* 删除目录及目录下所有文件或删除指定文件
* @param str $path 待删除目录路径
* @param int $delDir 是否删除目录,1或true删除目录,0或false则只删除文件保留目录(包含子目录)
... ...