生成二维码

admin2年前Laravel656

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;
}

返回列表

上一篇:用户注册账号

下一篇:修改密码

相关文章

腾讯云发送短信

<?phpnamespace App\Http\Controllers;use Illuminate\Http\Request;use Illuminate\Support\Facades\DB...

excel 导出

header("Content-Type: application/vnd.ms-excel; name='excel'"); header("Content-Disposition:atta...

发送公众号信息

* 发送消息 */public function tosend($openid, $title, $content, $time, $aid){    $tokens = $thi...

查找下级所有数据

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

按照距离远近排序

   $distance = "ACOS(SIN(( $lat * 3.1415) / 180 ) *SIN((lat * 3.1415) / 180 ) +COS((...

不重复 的推荐码

public function getcode(){    do {        $code = rand(10000000, 99999...