PcIssue.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. namespace App\Http\Controllers\api;
  3. use App\Models\Config;
  4. use Carbon\Carbon;
  5. use Illuminate\Http\JsonResponse;
  6. use App\Http\Controllers\api\Issue;
  7. use App\Http\Controllers\api\NewPc;
  8. /**
  9. * pc28,根据配置的游戏玩法返回指定的数据
  10. */
  11. class PcIssue extends BaseController
  12. {
  13. /**
  14. * @api {get} /pcissue/yuanTou 源头
  15. *
  16. */
  17. function yuanTou()
  18. {
  19. $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
  20. if ($pc28Switch == 1) {
  21. //pc28分分彩/极速28
  22. $issueController = new NewPc();
  23. } else {
  24. //pc28
  25. $issueController = new Issue();
  26. }
  27. return $issueController->yuanTou();
  28. }
  29. /**
  30. * @api {get} /pcissue/history 天机
  31. *
  32. */
  33. function history()
  34. {
  35. $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
  36. if ($pc28Switch == 1) {
  37. //pc28分分彩/极速28
  38. $issueController = new NewPc();
  39. } else {
  40. //pc28
  41. $issueController = new Issue();
  42. }
  43. return $issueController->history();
  44. }
  45. /**
  46. * @api {get} /pcissue/prediction 预测
  47. */
  48. function prediction()
  49. {
  50. $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
  51. if ($pc28Switch == 1) {
  52. //pc28分分彩/极速28
  53. $issueController = new NewPc();
  54. } else {
  55. //pc28
  56. $issueController = new Issue();
  57. }
  58. return $issueController->prediction();
  59. }
  60. /**
  61. * @api {get} /pcissue/countdown 倒计时
  62. *
  63. */
  64. public function countdown(): JsonResponse
  65. {
  66. //0:pc28 1:急速28
  67. $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
  68. if ($pc28Switch == 1) {
  69. $issueController = new NewPc();
  70. } else {
  71. //pc28
  72. $issueController = new Issue();
  73. }
  74. return $issueController->countdown();
  75. }
  76. /**
  77. * @api {get} /pcissue 结果,走势
  78. */
  79. public function index()
  80. {
  81. //0:pc28 1:急速28
  82. $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
  83. if ($pc28Switch == 1) {
  84. $issueController = new NewPc();
  85. } else {
  86. //pc28
  87. $issueController = new Issue();
  88. }
  89. return $issueController->index();
  90. }
  91. /**
  92. * @api {get} /pcissue/cao 统计,历史
  93. */
  94. public function cao()
  95. {
  96. $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
  97. if ($pc28Switch == 1) {
  98. //pc28分分彩/极速28
  99. $issueController = new NewPc();
  100. } else {
  101. //pc28
  102. $issueController = new Issue();
  103. }
  104. return $issueController->cao();
  105. }
  106. }