Index.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\controller\Frontend;
  4. use think\Db;
  5. class Index extends Frontend
  6. {
  7. protected $noNeedLogin = '*';
  8. protected $noNeedRight = '*';
  9. protected $layout = '';
  10. public function index()
  11. {
  12. return $this->view->fetch();
  13. }
  14. public function wxsharedownload(){
  15. $this->view->assign('downurl', config("site.apkurl"));
  16. return $this->view->fetch();
  17. }
  18. /**
  19. * app下载页
  20. * 判断是安卓还是ios
  21. */
  22. public function appdownload() {
  23. /*$this->view->assign('downurl', config("site.apkurl"));
  24. return $this->view->fetch();*/
  25. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  26. header("Location: ".config('site.ios_downurl'));
  27. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  28. //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
  29. //header("Location: ".$host."/index/index/download");
  30. $this->view->assign('downurl', config("site.android_apkUrl"));
  31. return $this->view->fetch();
  32. }else{
  33. $this->view->assign('downurl', config("site.android_apkUrl"));
  34. return $this->view->fetch();
  35. }
  36. }
  37. //基础文章网页
  38. public function basedata(){
  39. $key = input('key','');
  40. if(!$key){
  41. exit;
  42. }
  43. $content = Db::name('basedata')->where('key',$key)->find();
  44. $this->assign('content',$content['content']);
  45. return $this->fetch();
  46. }
  47. //系统公告
  48. public function messagesys(){
  49. $id = input('id','');
  50. if(!$id){
  51. exit;
  52. }
  53. $content = Db::name('message_sys')->where('id',$id)->find();
  54. $this->assign('content',$content['info']);
  55. return $this->fetch('basedata');
  56. }
  57. }