routes.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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("/", function () {
  66. // header("Location:/home-web/index"); // 首页
  67. //});
  68. Route::any("/pay", function () {
  69. return appExec("Payment", "Pay", "Index");
  70. });
  71. Route::any("/pay-(:any)", function ($method) {
  72. //toLog($_REQUEST);
  73. return appExec("Payment", "Pay", $method, 1);
  74. });
  75. Route::any("/prize", function () {
  76. return appExec("api", "prize", "prize");
  77. });
  78. //邀请路由
  79. Route::any("/invite/(:any)", function ($id) {
  80. //toLog($_REQUEST);
  81. \Biz\Account\Invite::init()->setInviteId(intval($id));
  82. if(is_mobile()){
  83. return appExec("Mobile", "Recommend", 'Index');
  84. }
  85. return appExec("Home", "Recommend", 'Index');
  86. });
  87. Route::any("/recommend/(:any)", function ($id) {
  88. //toLog($_REQUEST);
  89. \Biz\Account\Invite::init()->setInviteId(intval($id));
  90. if(is_mobile()){
  91. return appExec("Mobile", "Register", 'Index');
  92. }
  93. return appExec("Home", "Register", 'Index');
  94. });
  95. Route::any("/inprize", function () {
  96. return appExec("api", "prize", "pull");
  97. });
  98. Route::any("/open", function () {
  99. return appExec("api", "prize", "open");
  100. });
  101. Route::any("/dataSeeds", "App\Home\Controller\DataSeeds@Index");
  102. Route::any("/(:any)-(:any)/(:any)\.(:any)", function ($proj, $controller, $method, $format) {
  103. checkClose();
  104. S('CUR_RETURN_FORMAT', $format);
  105. return appExec($proj, $controller, $method);
  106. });
  107. Route::any("/(:any)-(:any)/(:any)", function ($proj, $controller, $method) {
  108. checkClose();
  109. return appExec($proj, $controller, $method);
  110. });
  111. Route::any("/(:any)/(:any)/(:any)\.(:any)", function ($proj, $controller, $method, $format) {
  112. checkClose();
  113. S('CUR_RETURN_FORMAT', $format);
  114. return appExec($proj, $controller, $method);
  115. });
  116. Route::any("/(:any)/(:any)/(:any)", function ($proj, $controller, $method) {
  117. checkClose();
  118. return appExec($proj, $controller, $method);
  119. });
  120. Route::any("/(:any)/(:any)/(:any)/", function ($proj, $controller, $method) {
  121. checkClose();
  122. return appExec($proj, $controller, $method);
  123. });
  124. //支付回调地址
  125. // Route::any("/(:any)/notify\.php", function ($paymentName) {
  126. // S('CUR_PAYMENT_NAME', $paymentName);
  127. // return appExec("Payment", "Pay", 'Notify');
  128. // });
  129. // Route::any("/(:any)/redirect\.php", function ($paymentName) {
  130. // S('CUR_PAYMENT_NAME', $paymentName);
  131. // return appExec("Payment", "Pay", 'Redirect');
  132. // });
  133. // Route::dispatch();