Ken 1 месяц назад
Родитель
Сommit
6a03017cb2
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      app/Http/Controllers/Api/Sport.php

+ 5 - 1
app/Http/Controllers/Api/Sport.php

@@ -17,6 +17,10 @@ public function index()
         $list = SportModel::where("game_time", ">=", $start)
             ->where("game_time", "<", $end)
             ->get();
-        return $this->success($list);
+        $count =  SportModel::where("game_time", ">=", $start)
+        ->where("game_time", "<", $end)->count();
+            $total = SportModel::count();
+
+        return $this->success(['list'=>$list, 'count'=>$count, 'total'=>$total]);
     }
 }