This commit is contained in:
salam committed 2026-09-25 11:38:52 +02:00
1 parent b90b057eb2
commit eb682c311b
2 files changed
+12 -14

No files matched your search

@@ -14,8 +14,6 @@ class ExpectationsTeam
/**
* STATTISTIC DATA
*/
$league_id = (int) $filter['league_id'] ?? 0;
$match_id = (int) $filter['match_id'] ?? 0;
$team_id = (int) $filter['team_id'] ?? 0;
$team_position = $filter['team_position'];
$similar_past_matches = $filter['similar_past_matches'];
@@ -57,7 +55,6 @@ class ExpectationsTeam
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
$count_events = 0;
foreach ($res as $value) {
// dd($value);
if ($team_id && $team_position == 'home') {
$count_events++;
switch ($value['result_code']) {
@@ -55,17 +55,18 @@ class LoadEventsQueryAll
$matches_played = [];
if ($ss_player_id) {
$matches_season = StatistikoEvent::where(function ($query) use ($team_id, $team_position) {
switch ($team_position) {
case 'home':
return $query->where('home_id', '=', $team_id);
case 'away':
return $query->where('away_id', '=', $team_id);
default:
return $query->where('home_id', '=', $team_id)
->orWhere('away_id', '=', $team_id);
}
})->pluck('match_id')->toArray();
$matches_season = StatistikoEvent::whereIn('season', $season)
->where(function ($query) use ($team_id, $team_position) {
switch ($team_position) {
case 'home':
return $query->where('home_id', '=', $team_id);
case 'away':
return $query->where('away_id', '=', $team_id);
default:
return $query->where('home_id', '=', $team_id)
->orWhere('away_id', '=', $team_id);
}
})->pluck('match_id')->toArray();
$matches_played = StatistikoPlayer::query()
->whereIn('match_id', $matches_season)