Index.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use think\Db;
  5. class Index extends Controller
  6. {
  7. //基础文章网页
  8. public function basedata(){
  9. $key = input('key','');
  10. if(!$key){
  11. exit;
  12. }
  13. $lang = input('lang','');
  14. $content = Db::name('basedata')->where('key',$key)->find();
  15. if($lang == 'EN'){
  16. $content['content'] = $content['content_en'];
  17. }
  18. $this->assign('content',$content['content']);
  19. return $this->fetch();
  20. }
  21. /**
  22. * app下载页
  23. * 判断是安卓还是ios
  24. */
  25. public function appdownload() {
  26. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  27. header("Location: ".config('site.ios_downurl'));
  28. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  29. $this->view->assign('downurl', config("site.android_apkUrl"));
  30. return $this->view->fetch();
  31. }else{
  32. $this->view->assign('downurl', config("site.android_apkUrl"));
  33. return $this->view->fetch();
  34. }
  35. }
  36. }