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