Index.php
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace app\index\controller;
use app\common\controller\Frontend;
class Index extends Frontend
{
protected $noNeedLogin = '*';
protected $noNeedRight = '*';
protected $layout = '';
public function index()
{
return $this->view->fetch();
}
/**
* 下载APP
*/
public function download()
{
$href = '';
$browser = 0;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') == true) {
$browser = 1;
} else if (strpos($_SERVER['HTTP_USER_AGENT'], 'AlipayClient') == true) {
$browser = 2;
}
if (stristr($_SERVER['HTTP_USER_AGENT'], 'Android')) {
//echo '你的手机是:Android系统';
// $ver = Db::name('version')->order('id', 'DESC')->find();
$href = request()->domain() . '/package/android_debug.apk';
} else if (stristr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
//echo '你的手机是:ISO系统';
$browser = 3;
}
$this->assign('url', $href);
$this->assign('browser', $browser);
return $this->view->fetch();
}
/**
* 用户协议及隐私协议
*/
public function agreement()
{
$content = db('mobile_config')->where('id',1)->value('agreement');
$this->assign('content',$content);
return $this->view->fetch();
}
}