JisuGameplay.php 1.4 KB

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