This commit is contained in:
salam committed 2026-09-12 20:38:22 +02:00
1 parent d3427927d7
commit 89867460c2
1 file changed
+5 -4
+5 -4
View File
@@ -548,9 +548,9 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
$res = StatisticFixtures::where('id', $this->filters['match_id'])->first();
$asp_team = 0;
if ((int) $res->home_id == (int) $team_id) {
$asp_team = $res->exp_home;
$asp_team = (float) $res->exp_home;
} elseif ((int) $res->away_id == (int) $team_id) {
$asp_team = $res->exp_away;
$asp_team = (float) $res->exp_away;
}
$player = StatistikoDetail::where('ss_team_id', (int) $team_id)->where('pos', '!=', 'GK')->where('is_active', 1)->get();
@@ -559,7 +559,7 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10.
// Ad esempio per Remo (supponiamo 24 giocatori nel Roster esclusi i portieri): ATR = 1.2 * 24 / 10 = 2.88
$asp_team_riferimento = $asp_team * $player->count() / 10;
$asp_team_riferimento = (float) $asp_team * $player->count() / 10;
$player_totals = SofaScorePlayerPerSeason::with('details')->where('season', 'total')->where('ss_team_id', $team_id)->get();
@@ -710,7 +710,8 @@ class BoardDispatcher extends Component implements HasActions, HasSchemas, HasTa
foreach ($results as $key => $value) {
// Aspettativa per Player: AP = AT * ATR / TOT AT
$results[$key]['asp_total_'.$bettype] = $total_bettype;
$results[$key]['asp_player_'.$bettype] = ((float) $value['asp_team'] * (float) $value['asp_teorica_'.$bettype]) / $total_bettype;
// $results[$key]['asp_player_'.$bettype] = ((float) $value['asp_team'] * (float) $value['asp_teorica_'.$bettype]) / $total_bettype;
$results[$key]['asp_player_'.$bettype] = ($asp_team * $asp_team_riferimento) / $total_bettype;
}
}