Index.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\controller\Frontend;
  4. use app\utils\PayUtil;
  5. use think\Db;
  6. class Index extends Frontend
  7. {
  8. protected $noNeedLogin = '*';
  9. protected $noNeedRight = '*';
  10. protected $layout = '';
  11. /**
  12. * 测试 汇付 支付
  13. */
  14. public function aa()
  15. {
  16. $pay = new PayUtil();
  17. $order_no = time().rand(1,200);
  18. $pay->jsPay('',"D0{$order_no}",'0.01','开通会员');
  19. return json_encode([
  20. 'order_no' => $order_no,
  21. 'data' => $pay->getData()
  22. ]);
  23. }
  24. public function index()
  25. {
  26. $code = input('code', '', 'trim'); //邀请码
  27. $this->view->assign('code', $code);
  28. $this->view->assign('downurl', config("site.apk_url"));
  29. $is_ios = 0;
  30. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  31. $is_ios = 1;
  32. }
  33. $this->view->assign('is_ios', $is_ios);
  34. return $this->view->fetch();
  35. }
  36. public function wxsharedownload(){
  37. $this->view->assign('downurl', config("site.apk_url"));
  38. return $this->view->fetch();
  39. }
  40. public function suningh5(){
  41. return $this->view->fetch();
  42. }
  43. /**
  44. * app下载页
  45. * 判断是安卓还是ios
  46. */
  47. public function appdownload() {
  48. echo 'hello wold';
  49. }
  50. /**
  51. * app下载页-新
  52. * 判断是安卓还是ios
  53. */
  54. public function downapp() {
  55. $code = input('code', '', 'trim'); //邀请码
  56. $this->view->assign('code', $code);
  57. $this->view->assign('downurl', config("site.apk_url"));
  58. return $this->view->fetch();
  59. // if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  60. // header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
  61. // }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  62. // //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
  63. // //header("Location: ".$host."/index/index/download");
  64. // $this->view->assign('downurl', config("site.apk_url"));
  65. // return $this->view->fetch();
  66. // }else{
  67. // $this->view->assign('downurl', config("site.apk_url"));
  68. // return $this->view->fetch();
  69. // }
  70. }
  71. //基础文章网页
  72. public function basedata(){
  73. $key = input('key','');
  74. if(!$key){
  75. exit;
  76. }
  77. $content = Db::name('basedata')->where('key',$key)->find();
  78. $this->assign('content',$content['content']);
  79. return $this->fetch();
  80. }
  81. }