You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.0 KiB
PHTML

5 years ago
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Home\Controller;
use User\Api\PromoteApi;
class ClineController extends HomeController {
//系统首页
public function index(){
$android = M('app', 'tab_')->find(5);
$ios = M('app', 'tab_')->find(6);
$this->assign('android',$android);
$this->assign('ios',$ios);
$this->display();
}
public function qrcode($level=3,$size=4,$url=""){
Vendor('phpqrcode.phpqrcode');
$errorCorrectionLevel =intval($level) ;//容错级别
$matrixPointSize = intval($size);//生成图片大小
//生成二维码图片
ob_clean();
$object = new \QRcode();
echo $object->png(base64_decode(base64_decode($url)), false, $errorCorrectionLevel, $matrixPointSize, 2);
}
public function download(){
if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
$system = 1;
$type = 4;
$version_name = C('IOS_VERSION');
}else{
$system = 2;
$type = 1;
$version_name = C("APP_VERSION");
}
$data = M('app', 'tab_')->find($type);
if(!preg_match('/^http(s)?/', $data['file_url'])) {
$data['file_url'] = "http://".$_SERVER['HTTP_HOST'].substr($data['file_url'],1);
}
$data['plist_url'] = "https://".$_SERVER['HTTP_HOST'].substr($data['plist_url'],1);
$this->assign('data',$data);
$this->assign('system',$system);
$this->assign('version_name',$version_name);
$this->assign('app_name',C(APP_NAME)."");
$this->assign('logo_name',get_cover(C('WAP_APP_ICON'),'path'));
$this->display();
}
/**
*联运APP 下载
*/
public function ly_download(){
if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
$system = 1;
$appID = 6;
$version_name = C('IOS_VERSION');
}else{
$system = 2;
$appID = 5;
$version_name = C("APP_VERSION");
}
$data = M('app', 'tab_')->find($appID);
$data['file_url'] = "http://".$_SERVER['HTTP_HOST'].substr($data['file_url'],1);
$data['plist_url'] = "https://".$_SERVER['HTTP_HOST'].substr($data['plist_url'],1);
$this->assign('data',$data);
$this->assign('system',$system);
$this->assign('version_name',$version_name);
$this->assign('app_name',"渠道管家APP");
$this->assign('logo_name',"/Public/Home/images/qudaoguanjia.png");
$this->display('download');
}
}