生成二维码

admin2年前Laravel750

public function qrcode($uid)
{
   require_once base_path() . '/public/phpqrcode/phpqrcode.php';
   $imageName = "p_" . date("His", time()) . "_" . rand(1111, 9999) . '.jpg';
   $domain = $this->domain();
   $path = "upload/qrcode/" . date("Ymd");
   if (!is_dir($path)) { //判断目录是否存在 不存在就创建
       mkdir($path, 0777, true);
       chmod($path, 0777);
   }
   $msg = $uid;
   $msg1 = \QRcode::png($domain . '/h5?scene=' . $msg, $path . '/' . $imageName, 'L', 6, 5); // 生成二维码并保存为文件
   Db::table('member')->where(array('id' => $this->user_id))->update(['qrcode' => $path . '/' . $imageName]);
   return $path . '/' . $imageName;
}

返回列表

上一篇:用户注册账号

下一篇:修改密码

相关文章

查找下级所有数据

public function bottom($mid = 3){    $members = DB::select('select id,parent_id,`level...

抖音小程序登录

$code = request()->input('code');$nickname = request()->input('nickName');$ava...

小程序的二维码

    public function qrcode()    {        $qcode = "http...

微信退款v3

/** * 微信 退款 操作 */ public function refund($out_trade_no, $refund_money) { $time = time();...

下载文件

public function img_url() { $id = request()->param('id', 1122); $info = Db::name('...

设置项目编号

$max = Db::table('member')->max('id') ?? 0; if ($max < 100000) { $cd = $this->create...