wip season

This commit is contained in:
salam committed 2026-08-25 08:16:12 +02:00
1 parent c6c5cdc1b1
commit 800917cad0
1 file changed
+10 -9
@@ -18,21 +18,22 @@ class LoadEventsAverages
$statistic_type = $filter['statistic_type'] ?? 'gls'; $statistic_type = $filter['statistic_type'] ?? 'gls';
$res = SofaScoreTournament::with('sofascore_category')->where('tournament_id', $tournament_id)->first(); $season = $filter['season'] ?? 0;
$country_id = $res->sofascore_category->country_id; $season_or_date = $filter['season_or_date'] ?? 'season';
$season_mode = Country::where('id', $country_id)->value('season_mode');
if ($season_mode == 'fullyear') { if ($season_or_date != 'season')
$season = date('Y'); $season = 0;
} else {
$season = date('y') - 1 . '/' . date('Y');
}
$res = StatistikoEvent::where('league_id', $tournament_id) $res = StatistikoEvent::where('league_id', $tournament_id)
// ->where('season', $season) ->when($season, function ($query) use ($season) {
return $query->whereIn('season', $season);
})
->orderBy('starttime', 'ASC') ->orderBy('starttime', 'ASC')
->get(); ->get();
// dd($res);
if ($res) { if ($res) {
$team_home = []; $team_home = [];