Index.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use think\Db;
  5. use think\Request;
  6. class Index extends Controller
  7. {
  8. public function index(){
  9. }
  10. //支付成功页
  11. public function paysuccess(){
  12. return $this->fetch();
  13. }
  14. //基础文章网页
  15. public function basedata(){
  16. $key = input('key','','trim');
  17. if(!$key){
  18. exit;
  19. }
  20. $lang = input('lang','zh-cn','strtolower');
  21. $content = Db::name('basedata')->where('key',$key)->find();
  22. if($lang == 'en'){
  23. $content['content'] = $content['content_en'];
  24. }
  25. $this->assign('content',$content['content']);
  26. return $this->fetch();
  27. }
  28. /**
  29. * app下载页
  30. * 判断是安卓还是ios
  31. * 用不到了,现在使用 index/appdown/index
  32. */
  33. public function appdownload() {
  34. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  35. header("Location: ".config('site.ios_downurl'));
  36. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  37. $this->view->assign('downurl', config("site.android_apkUrl"));
  38. return $this->view->fetch();
  39. }else{
  40. $this->view->assign('downurl', config("site.android_apkUrl"));
  41. return $this->view->fetch();
  42. }
  43. }
  44. }