Index.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. $code = input('code', '', 'trim'); //邀请码
  13. $this->view->assign('code', $code);
  14. $this->view->assign('downurl', config("site.apk_url"));
  15. $is_ios = 0;
  16. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  17. $is_ios = 1;
  18. }
  19. $this->view->assign('is_ios', $is_ios);
  20. return $this->view->fetch();
  21. }
  22. public function wxsharedownload(){
  23. $this->view->assign('downurl', config("site.apk_url"));
  24. return $this->view->fetch();
  25. }
  26. public function suningh5(){
  27. return $this->view->fetch();
  28. }
  29. /**
  30. * app下载页
  31. * 判断是安卓还是ios
  32. */
  33. public function appdownload() {
  34. echo 'hello wold';
  35. }
  36. /**
  37. * app下载页-新
  38. * 判断是安卓还是ios
  39. */
  40. public function downapp() {
  41. $code = input('code', '', 'trim'); //邀请码
  42. $this->view->assign('code', $code);
  43. $this->view->assign('downurl', config("site.apk_url"));
  44. return $this->view->fetch();
  45. // if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  46. // header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
  47. // }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  48. // //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
  49. // //header("Location: ".$host."/index/index/download");
  50. // $this->view->assign('downurl', config("site.apk_url"));
  51. // return $this->view->fetch();
  52. // }else{
  53. // $this->view->assign('downurl', config("site.apk_url"));
  54. // return $this->view->fetch();
  55. // }
  56. }
  57. //基础文章网页
  58. public function basedata(){
  59. $key = input('key','');
  60. if(!$key){
  61. exit;
  62. }
  63. $content = Db::name('basedata')->where('key',$key)->find();
  64. $this->assign('content',$content['content']);
  65. return $this->fetch();
  66. }
  67. }