生成二维码

admin2年前Laravel698

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 image(){    $obFile = request()->file('image');    if...

编辑用户信息

*/public function useredit(){    $avatar = request()->input('avatar');   &...

获取域名

/** * 获取域名 */public function domain(){    return request()->getSchemeAndHttpHost();}...

百度浏览器中视频悬浮

  <video class="html5-video"                poster=...

生成唯一的订单号

public function get_order_sn() {     return date('Ymd') ...

公众号登录

public function wxlogin(){       $code = request()->input('code'); &n...