StatistikoEvent in LoadEvents for statistiks

This commit is contained in:
salam committed 2026-05-21 15:44:02 +02:00
1 parent ac8d21178b
commit f40009a878
3 files changed
+12 -7

No files matched your search

+4 -5
View File
@@ -2,7 +2,6 @@
namespace App\Actions\Statistics;
use App\Models\StatisticFixtures;
use App\Models\StatistikoEvent;
class LoadEvents
@@ -33,17 +32,17 @@ class LoadEvents
/**
* ACCURACY DATA
*/
switch ($filter['team_position']) {
switch ($team_position) {
case 'home':
$res = StatisticFixtures::where('league_id', $league_id)->where('home_id', $team_id)->first();
$res = StatistikoEvent::where('league_id', $league_id)->where('home_id', $team_id)->first();
break;
case 'away':
$res = StatisticFixtures::where('league_id', $league_id)->where('away_id', $team_id)->first();
$res = StatistikoEvent::where('league_id', $league_id)->where('away_id', $team_id)->first();
break;
default:
$res = StatisticFixtures::where('league_id', $league_id)
$res = StatistikoEvent::where('league_id', $league_id)
->where(function ($query) use ($team_id) {
$query->where('home_id', '=', $team_id)->orWhere('away_id', '=', $team_id);
})->first();