Index.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  24. header("Location: ".config('site.ios_downurl'));
  25. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  26. $this->view->assign('downurl', config("site.android_apkUrl"));
  27. return $this->view->fetch();
  28. }else{
  29. $this->view->assign('downurl', config("site.android_apkUrl"));
  30. return $this->view->fetch();
  31. }
  32. }
  33. //基础文章网页
  34. public function basedata(){
  35. $key = input('key','');
  36. if(!$key){
  37. exit;
  38. }
  39. $content = Db::name('basedata')->where('key',$key)->find();
  40. if(empty($content)){
  41. exit;
  42. }
  43. $this->assign('content',$content['content']);
  44. return $this->fetch();
  45. }
  46. //系统公告
  47. public function messagesys(){
  48. $id = input('id','');
  49. if(!$id){
  50. exit;
  51. }
  52. $content = Db::name('message_sys')->where('id',$id)->find();
  53. $this->assign('content',$content['info']);
  54. return $this->fetch('basedata');
  55. }
  56. }