代碼部分

namespace app/home/controller; use think/Page;" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

15158846557 在線咨詢 在線咨詢
15158846557 在線咨詢
所在位置: 首頁 > 營銷資訊 > 網(wǎng)站運(yùn)營 > 商城網(wǎng)站建設(shè)電商在線網(wǎng)站開發(fā)源碼

商城網(wǎng)站建設(shè)電商在線網(wǎng)站開發(fā)源碼

時(shí)間:2023-08-18 13:00:01 | 來源:網(wǎng)站運(yùn)營

時(shí)間:2023-08-18 13:00:01 來源:網(wǎng)站運(yùn)營

商城網(wǎng)站建設(shè)電商在線網(wǎng)站開發(fā)源碼:企業(yè)想要擴(kuò)展自己的電商業(yè)務(wù),開發(fā)一款好的電商系統(tǒng)必不可少。電商商城網(wǎng)站就是不錯(cuò)的選擇,下面就來分享一下網(wǎng)站的代碼。

代碼部分

namespace app/home/controller; use think/Page;use think/Verify;use think/Db;use think/Image;class Index extends Base{public function index(){$web_list = S('web_index_data');if(!$web_list){$web_list = M('web')->where(array('web_show'=>1))->order('web_sort')->select();if($web_list){foreach ($web_list as $kb=>$vb){ $block_list = M('web_block')->where(array('web_id'=>$vb['web_id']))->order('web_id')->select();if(is_array($block_list) && !empty($block_list)) { foreach ($block_list as $key => $val) {//將變量輸出到頁面$val['block_info'] = unserialize($val['block_info']);$web_list[$kb][$val['var_name']] = $val['block_info'];}}}S('web_index_data',$web_list);}}$this->assign('web_list', $web_list);return $this->fetch();}公告詳情頁

public function notice() {return $this->fetch();}public function qr_code_raw() {ob_end_clean();// 導(dǎo)入Vendor類庫包 Library/Vendor/Zend/Server.class.phpvendor('phpqrcode.phpqrcode');//import('Vendor.phpqrcode.phpqrcode');error_reporting(E_ERROR);$url = urldecode($_GET["data"]);/QRcode::png($url);exit; }用戶分銷二維碼

public function qr_code() {ob_end_clean();vendor('topthink.think-image.src.Image');vendor('phpqrcode.phpqrcode');error_reporting(E_ERROR); $url = isset($_GET['data']) ? $_GET['data'] : '';$url = urldecode($url); $head_pic = input('get.head_pic', ''); $back_img = input('get.back_img', ''); $valid_date = input('get.valid_date', 0); $qr_code_path = './public/upload/qr_code/'; if (!file_exists($qr_code_path)) { mkdir($qr_code_path); } /* 生成二維碼 */ $qr_code_file = $qr_code_path.time().rand(1, 10000).'.png'; /QRcode::png($url, $qr_code_file, QR_ECLEVEL_M); /* 二維碼疊加水印 */ $QR = Image::open($qr_code_file); $QR_width = $QR->width(); $QR_height = $QR->height(); /* 添加背景圖 */ if ($back_img && file_exists($back_img)) { $back =Image::open($back_img); $back->thumb($QR_width, $QR_height, /think/Image::THUMB_CENTER) ->water($qr_code_file, /think/Image::WATER_NORTHWEST, 60);//->save($qr_code_file); $QR = $back; } /* 添加頭像 */ if ($head_pic) { //如果是網(wǎng)絡(luò)頭像 if (strpos($head_pic, 'http') === 0) { //下載頭像 $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $head_pic); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $file_content = curl_exec($ch); curl_close($ch); //保存頭像 if ($file_content) { $head_pic_path = $qr_code_path.time().rand(1, 10000).'.png'; file_put_contents($head_pic_path, $file_content); $head_pic = $head_pic_path; } } //如果是本地頭像 if (file_exists($head_pic)) { $logo = Image::open($head_pic); $logo_width = $logo->height(); $logo_height = $logo->width(); $logo_qr_width = $QR_width / 5; $scale = $logo_width / $logo_qr_width; $logo_qr_height = $logo_height / $scale; $logo_file = $qr_code_path.time().rand(1, 10000); $logo->thumb($logo_qr_width, $logo_qr_height)->save($logo_file, null, 100); $QR = $QR->thumb($QR_width, $QR_height)->water($logo_file, /think/Image::WATER_CENTER); unlink($logo_file); } if ($head_pic_path) { unlink($head_pic_path); } } if ($valid_date && strpos($url, 'weixin.qq.com') !== false) { $QR = $QR->text('有效時(shí)間 '.$valid_date, "./vendor/topthink/think-captcha/assets/zhttfs/1.ttf", 7, '#00000000', Image::WATER_SOUTH); } $QR->save($qr_code_file, null, 100); $qrHandle = imagecreatefromstring(file_get_contents($qr_code_file)); unlink($qr_code_file); //刪除二維碼文件 header("Content-type: image/png"); imagepng($qrHandle); imagedestroy($qrHandle); exit; }

關(guān)鍵詞:發(fā)源,建設(shè),商城

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉