public function qrcode() { $user = $this->get_user(); $qrcode = $user['qrcode']; if (empty($qrcode)) { $url = "http://" . $_SERVER['HTTP_HOST'] . "/index.php?g=mobile&m=attend&a=help&openid=" . $user['openid']; $qrcode = str_replace(ROOT_PATH, "/", yf_qrcode($url, 10, true, $_SESSION['wxid'])); Model('attend')->update_qrcode($qrcode, $_SESSION['wxid']); } $config[c] = array('site_name' => '协助认证-' . Model('app')->get_cfg('site_name')); $this->assign_global($config); $this->assign("qrcode", $qrcode); $this->display("qrcode.html"); }
public function qrcode() { if ($_POST) { $url = yf_empty($_POST['url'], "请输入要生成二维码的链接"); $size = yf_empty(intval($_POST['size']), 10, 'size'); $name = yf_empty($_POST['name'], '', true); $status = yf_empty(intval($_POST['status']), 0, true); if ($status == 0) { $path = yf_qrcode($url, $size, true, $name); yf_down($path); } else { $path = yf_qrcode($url, $size); // $this->assign("code", $path); } } $this->display("qrcode.html"); }