wip season
This commit is contained in:
1 parent
c6c5cdc1b1
commit
800917cad0
1 file changed
+10
-9
@@ -18,21 +18,22 @@ class LoadEventsAverages
|
||||
|
||||
$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_mode = Country::where('id', $country_id)->value('season_mode');
|
||||
if ($season_mode == 'fullyear') {
|
||||
$season = date('Y');
|
||||
} else {
|
||||
$season = date('y') - 1 . '/' . date('Y');
|
||||
}
|
||||
$season_or_date = $filter['season_or_date'] ?? 'season';
|
||||
|
||||
if ($season_or_date != 'season')
|
||||
$season = 0;
|
||||
|
||||
$res = StatistikoEvent::where('league_id', $tournament_id)
|
||||
// ->where('season', $season)
|
||||
->when($season, function ($query) use ($season) {
|
||||
return $query->whereIn('season', $season);
|
||||
})
|
||||
->orderBy('starttime', 'ASC')
|
||||
->get();
|
||||
|
||||
// dd($res);
|
||||
|
||||
if ($res) {
|
||||
|
||||
$team_home = [];
|
||||
|
||||
Reference in new issue
Block a user