lip 2 недель назад
Родитель
Сommit
f4d0b854a5
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      app/Models/JisuGameplay.php

+ 7 - 1
app/Models/JisuGameplay.php

@@ -8,9 +8,15 @@ class JisuGameplay extends BaseModel
     protected $fillable = [ 'game', 'game_en', 'gameplay', 'gameplay_en', 'number', 'number_en', 'odds','type','maxinum','mininum'];
     protected $fillable = [ 'game', 'game_en', 'gameplay', 'gameplay_en', 'number', 'number_en', 'odds','type','maxinum','mininum'];
     
     
     public static function getGame($type) {
     public static function getGame($type) {
-        $list = JisuGameplay::where('type',$type)->get()->toArray();
+        $list = JisuGameplay::where('type',$type)->select()->toArray();
         $tree = [];
         $tree = [];
         foreach($list as $item) {
         foreach($list as $item) {
+            if (!isset($tree[$item['gameplay']])) {
+                $tree[$item['gameplay']] = [
+                    'gameplay' => $item['gameplay'],
+                    'gameplay_en' => $item['gameplay_en'],
+                ];
+            }
             $tree[$item['gameplay']]['children'][] = [
             $tree[$item['gameplay']]['children'][] = [
                 'id' => $item['id'],
                 'id' => $item['id'],
                 'type' => $item['type'],
                 'type' => $item['type'],