This commit is contained in:
salam committed 2026-08-24 19:13:37 +02:00
1 parent 3f5c1cf753
commit d316d486b9
3 files changed
+37 -74

No files matched your search

@@ -4,6 +4,7 @@ namespace App\Filament\Widgets\Data\LoadEvents;
use App\Models\SofaScoreTournament;
use App\Models\StatistikoEvent;
use App\Models\Country;
class LoadEventsAverages
{
@@ -17,10 +18,10 @@ class LoadEventsAverages
$statistic_type = $filter['statistic_type'] ?? 'gls';
$res = SofaScoreTournament::with('sofascore_category')->where('tournament_id', $tournament_id)->first();
$season_mode = $res->sofascore_category->country->season_mode;
$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 {
@@ -28,7 +29,7 @@ class LoadEventsAverages
}
$res = StatistikoEvent::where('league_id', $tournament_id)
->where('season', $season)
// ->where('season', $season)
->orderBy('starttime', 'ASC')
->get();
@@ -78,8 +79,6 @@ class LoadEventsAverages
break;
}
// dd($team_position, $team_id, $value);
if ((!$team_position || $team_position == 'all') && ($team_id == $value['home_id'] or $team_id == $value['away_id'])) {
switch ($statistic_type) {
case 'gls':