JisuGameplay.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Models;
  3. class JisuGameplay extends BaseModel
  4. {
  5. protected $table = 'jisu_gameplay';
  6. protected $fillable = [ 'game', 'game_en', 'gameplay', 'gameplay_en', 'number', 'number_en', 'odds','type','maxinum','mininum'];
  7. public static function getGame($type) {
  8. $list = JisuGameplay::where('type',$type)->select()->toArray();
  9. $tree = [];
  10. foreach($list as $k => $item) {
  11. if (!isset($tree[$item['game']])) {
  12. $tree[$item['game']] = [
  13. 'name' => $item['game'],
  14. 'name_en' => $item['game_en'],
  15. ];
  16. }
  17. if (!isset($tree[$item['game']]['children'][$item['gameplay']])) {
  18. $tree[$item['game']]['children'][$item['gameplay']] = [
  19. 'name' => $item['gameplay'],
  20. 'name_en' => $item['gameplay_en'],
  21. ];
  22. }
  23. $tree[$item['game']]['children'][$item['gameplay']]['children'][] = [
  24. 'name' => $item['number'],
  25. 'name_en' => $item['number_en'],
  26. 'odds' => $item['odds'],
  27. 'maxinum' => $item['maxinum'],
  28. 'mininum' => $item['mininum'],
  29. ];
  30. }
  31. $tree = array_values($tree);
  32. foreach ($tree as $k=> &$item) {
  33. $item['children'] = array_values($item['children']);
  34. }
  35. return ($tree);
  36. }
  37. public static function getRemark($type) {
  38. if ($type == 1) {
  39. return '极速赛车';
  40. } elseif ($type == 2) {
  41. return '极速时时彩';
  42. } elseif ($type == 3) {
  43. return '3极速飞艇';
  44. }
  45. }
  46. }