This commit is contained in:
salam committed 2026-05-21 16:28:22 +02:00
1 parent fd4c44de9c
commit 04d7bb2884
1 file changed
+13 -5
+13 -5
View File
@@ -63,6 +63,14 @@ class LoadEvents
$end = $filter['end_date'] ?? 0;
$similar_past_matches = $filter['similar_past_matches'] ?? 0;
$statistic_type = $filter['statistic_type'] ?? 0;
// 'none' => 'None',
// 'league' => 'League',
// 'all' => 'All Database',
/**
* STATTISTIC DATA
*/
@@ -70,7 +78,7 @@ class LoadEvents
case 'home':
$res = StatistikoEvent::where('league_id', $league_id)
->where('home_id', '=', $team_id)
->whereBetween('exp_home', [$exp_home_from, $exp_home_to])
// ->whereBetween('exp_home', [$exp_home_from, $exp_home_to])
->when($start, function ($query) use ($start) {
return $query->where('starttime', '>=', $start);
})->when($end, function ($query) use ($end) {
@@ -82,7 +90,7 @@ class LoadEvents
case 'away':
$res = StatistikoEvent::where('league_id', $league_id)
->where('away_id', '=', $team_id)
->whereBetween('exp_away', [$exp_away_from, $exp_away_to])
// ->whereBetween('exp_away', [$exp_away_from, $exp_away_to])
->when($start, function ($query) use ($start) {
return $query->where('starttime', '>=', $start);
})->when($end, function ($query) use ($end) {
@@ -96,9 +104,9 @@ class LoadEvents
->where(function ($query) use ($team_id) {
$query->where('home_id', '=', $team_id)->orWhere('away_id', '=', $team_id);
})
->where(function ($query) use ($exp_home_from, $exp_home_to, $exp_away_from, $exp_away_to) {
$query->whereBetween('exp_home', [$exp_home_from, $exp_home_to])->orWhereBetween('exp_away', [$exp_away_from, $exp_away_to]);
})
// ->where(function ($query) use ($exp_home_from, $exp_home_to, $exp_away_from, $exp_away_to) {
// $query->whereBetween('exp_home', [$exp_home_from, $exp_home_to])->orWhereBetween('exp_away', [$exp_away_from, $exp_away_to]);
// })
->when($start, function ($query) use ($start) {
return $query->where('starttime', '>=', $start);
})->when($end, function ($query) use ($end) {