routes.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. //新版代理分享链接路由控制 2018-12-08 anton liu
  3. if (isset($_GET['invita']) && !empty($_GET['invita'])) {
  4. \Biz\Account\Invite::init()->setInvitaId($_GET['invita']);
  5. if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
  6. $uri = 'https://'.$_SERVER['HTTP_HOST'];
  7. } else {
  8. $uri = 'http://'.$_SERVER['HTTP_HOST'];
  9. }
  10. if(is_mobile()){ //手机
  11. $link = lm('setinfo', 'commons')->select('infocontent')->where('infotype', 2005)->first();
  12. if(strpos($link->infocontent,'http') !== false || strpos($link->infocontent,'https') !== false)
  13. {
  14. $uri = $link->infocontent;
  15. header("Location:".$uri."?invita=".$_GET['invita']);
  16. exit();
  17. }else{
  18. if($link->infocontent){
  19. header("Location:".$uri.$link->infocontent."?invita=".$_GET['invita']);
  20. exit();
  21. }else{
  22. header("Location:".$uri."/m/#/shareReg?invita=".$_GET['invita']);
  23. exit();
  24. }
  25. }
  26. }else{
  27. //pc版
  28. //获取是否开启分享推广页面
  29. $data = lm('setinfo', 'commons')->select('status')->where('infotype', 1024)->first();
  30. if($data->status == 1){
  31. header("Location:".$uri."/Home-Register/Share"); //分享
  32. exit();
  33. }elseif($data->status == 0){
  34. header("Location:".$uri."/Home-Register/Index"); //注册
  35. exit();
  36. }else{
  37. header("Location:".$uri."/Home-Index/Index"); // 首页
  38. exit();
  39. }
  40. }
  41. }
  42. if(isset($_GET['invite_id']) && intval($_GET['invite_id'])>0){
  43. \Biz\Account\Invite::init()->setInviteId(intval($_GET['invite_id']));
  44. }
  45. if (isset($_GET['invite']) && intval($_GET['invite']) > 0) {
  46. \Biz\Account\Invite::init()->setInviteId(intval($_GET['invite']));
  47. }
  48. // toDomain();
  49. Route::any("/close", function () {
  50. return appExec("api", "close", "CloseWeb");
  51. });
  52. Route::any("/login", function () {
  53. return appExec("Sports","Login","login");
  54. });
  55. Route::any("/rollingball", function () {
  56. return appExec("Sports","RollingBall","getrollingball");
  57. });
  58. Route::any("/time", function () {
  59. return appExec("api", "common", "getTime");
  60. });
  61. Route::any("/", function () {
  62. checkClose();
  63. header('location:/home-index/index');
  64. });
  65. Route::any("/pay", function () {
  66. return appExec("Payment", "Pay", "Index");
  67. });
  68. Route::any("/pay-(:any)", function ($method) {
  69. //toLog($_REQUEST);
  70. return appExec("Payment", "Pay", $method, 1);
  71. });
  72. Route::any("/prize", function () {
  73. return appExec("api", "prize", "prize");
  74. });
  75. //邀请路由
  76. Route::any("/invite/(:any)", function ($id) {
  77. //toLog($_REQUEST);
  78. \Biz\Account\Invite::init()->setInviteId(intval($id));
  79. if(is_mobile()){
  80. return appExec("Mobile", "Recommend", 'Index');
  81. }
  82. return appExec("Home", "Recommend", 'Index');
  83. });
  84. Route::any("/recommend/(:any)", function ($id) {
  85. //toLog($_REQUEST);
  86. \Biz\Account\Invite::init()->setInviteId(intval($id));
  87. if(is_mobile()){
  88. return appExec("Mobile", "Register", 'Index');
  89. }
  90. return appExec("Home", "Register", 'Index');
  91. });
  92. Route::any("/inprize", function () {
  93. return appExec("api", "prize", "pull");
  94. });
  95. Route::any("/open", function () {
  96. return appExec("api", "prize", "open");
  97. });
  98. Route::any("/dataSeeds", "App\Home\Controller\DataSeeds@Index");
  99. Route::any("/(:any)-(:any)/(:any)\.(:any)", function ($proj, $controller, $method, $format) {
  100. checkClose();
  101. S('CUR_RETURN_FORMAT', $format);
  102. return appExec($proj, $controller, $method);
  103. });
  104. Route::any("/(:any)-(:any)/(:any)", function ($proj, $controller, $method) {
  105. checkClose();
  106. return appExec($proj, $controller, $method);
  107. });
  108. Route::any("/(:any)/(:any)/(:any)\.(:any)", function ($proj, $controller, $method, $format) {
  109. checkClose();
  110. S('CUR_RETURN_FORMAT', $format);
  111. return appExec($proj, $controller, $method);
  112. });
  113. Route::any("/(:any)/(:any)/(:any)", function ($proj, $controller, $method) {
  114. checkClose();
  115. return appExec($proj, $controller, $method);
  116. });
  117. Route::any("/(:any)/(:any)/(:any)/", function ($proj, $controller, $method) {
  118. checkClose();
  119. return appExec($proj, $controller, $method);
  120. });
  121. //支付回调地址
  122. // Route::any("/(:any)/notify\.php", function ($paymentName) {
  123. // S('CUR_PAYMENT_NAME', $paymentName);
  124. // return appExec("Payment", "Pay", 'Notify');
  125. // });
  126. // Route::any("/(:any)/redirect\.php", function ($paymentName) {
  127. // S('CUR_PAYMENT_NAME', $paymentName);
  128. // return appExec("Payment", "Pay", 'Redirect');
  129. // });
  130. // Route::dispatch();