12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\index\controller;
- use think\Controller;
- use think\Db;
- use think\Request;
- class Index extends Controller
- {
- public function index(){
- }
- //基础文章网页
- public function basedata(){
- $key = input('key','','trim');
- if(!$key){
- exit;
- }
- $request = Request::instance();
- $lang = $request->header('lang','zh-cn');
- $content = Db::name('basedata')->where('key',$key)->find();
- if($lang == 'en'){
- $content['content'] = $content['content_en'];
- }
- $this->assign('content',$content['content']);
- return $this->fetch();
- }
- /**
- * app下载页
- * 判断是安卓还是ios
- */
- public function appdownload() {
- if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
- header("Location: ".config('site.ios_downurl'));
- }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
- $this->view->assign('downurl', config("site.android_apkUrl"));
- return $this->view->fetch();
- }else{
- $this->view->assign('downurl', config("site.android_apkUrl"));
- return $this->view->fetch();
- }
- }
- }
|