wip
This commit is contained in:
1 parent
0cb9b16bad
commit
e19b5ab54b
5 files changed
+50
-40
No files matched your search
@@ -262,9 +262,9 @@ class PlayerPropsDrop extends Widget
|
||||
foreach ($this->calculationVariables as $row) {
|
||||
if ($copystring == '') {
|
||||
$keys = array_keys($row);
|
||||
$copystring .= implode(';', $keys)."\n";
|
||||
$copystring .= implode(';', $keys) . "\n";
|
||||
}
|
||||
$copystring .= implode(';', $row)."\n";
|
||||
$copystring .= implode(';', $row) . "\n";
|
||||
}
|
||||
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
||||
|
||||
@@ -284,7 +284,7 @@ class PlayerPropsDrop extends Widget
|
||||
return;
|
||||
}
|
||||
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd'];
|
||||
$copystring = implode(';', $header)."\n";
|
||||
$copystring = implode(';', $header) . "\n";
|
||||
foreach ($this->players as $row) {
|
||||
$tmp = [];
|
||||
$tmp[] = $row['name'];
|
||||
@@ -304,7 +304,7 @@ class PlayerPropsDrop extends Widget
|
||||
$tmp[] = $row['tsh'];
|
||||
$tmp[] = $row['crd'];
|
||||
|
||||
$copystring .= implode(';', $tmp)."\n";
|
||||
$copystring .= implode(';', $tmp) . "\n";
|
||||
}
|
||||
$this->js("navigator.clipboard.writeText(`$copystring`)");
|
||||
|
||||
@@ -416,6 +416,11 @@ class PlayerPropsDrop extends Widget
|
||||
// Somma Minuti Giocati da Player (SMG) nel DB
|
||||
$tmp['somma_minuti'] = $val->total_min;
|
||||
|
||||
|
||||
$tmp['shots_on_target'] = $val->shots_on_target;
|
||||
$tmp['shots_off_target'] = $val->shots_off_target;
|
||||
$tmp['shots_blocked'] = $val->shots_blocked;
|
||||
|
||||
// il valore corrispondente al ruolo del Player (esempio un giocatore in Details ha ruolo = RW
|
||||
// quindi Aspettativa Statistica (AS) per RW = 0.219)
|
||||
// exp_goals
|
||||
@@ -430,68 +435,68 @@ class PlayerPropsDrop extends Widget
|
||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
||||
foreach ($bettypes as $bettype) {
|
||||
|
||||
$asp_statistica = (float) SofaScorePlayerPosition::where('ss_code', $position)->value('exp_'.$bettype);
|
||||
$tmp['asp_statistica_'.$bettype] = $asp_statistica;
|
||||
$asp_statistica = (float) SofaScorePlayerPosition::where('ss_code', $position)->value('exp_' . $bettype);
|
||||
$tmp['asp_statistica_' . $bettype] = $asp_statistica;
|
||||
|
||||
switch ($bettype) {
|
||||
case 'goals':
|
||||
if ($val->total_min < $this->y_value || $val->goals == 0) {
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
||||
} else {
|
||||
$asp_gioco = $val->goals / $val->total_min * 90;
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
}
|
||||
break;
|
||||
case 'cards':
|
||||
if ($val->total_min < $this->y_value || $val->cards == 0) {
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
||||
} else {
|
||||
$asp_gioco = $val->cards / $val->total_min * 90;
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
}
|
||||
break;
|
||||
case 'fouls':
|
||||
if ($val->total_min < $this->y_value || $val->fouls == 0) {
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
||||
} else {
|
||||
$asp_gioco = $val->fouls / $val->total_min * 90;
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
}
|
||||
break;
|
||||
case 'offsides':
|
||||
if ($val->total_min < $this->y_value || $val->offsides == 0) {
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
||||
} else {
|
||||
$asp_gioco = $val->offsides / $val->total_min * 90;
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
}
|
||||
break;
|
||||
case 'total_shots':
|
||||
if ($val->total_min < $this->y_value || $val->total_shots == 0) {
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
||||
} else {
|
||||
$asp_gioco = $val->total_shots / $val->total_min * 90;
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
}
|
||||
break;
|
||||
case 'shots_on_target':
|
||||
if ($val->total_min < $this->y_value || $val->shots_on_target == 0) {
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_'.$bettype] = $asp_statistica;
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_statistica;
|
||||
$tmp['asp_teorica_' . $bettype] = $asp_statistica;
|
||||
} else {
|
||||
$asp_gioco = $val->shots_on_target / $val->total_min * 90;
|
||||
$tmp['asp_gioco_'.$bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_'.$bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
$tmp['asp_gioco_' . $bettype] = $asp_gioco;
|
||||
$tmp['asp_teorica_' . $bettype] = ($this->x_value * $asp_gioco + $asp_statistica) / (1 + $this->x_value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -508,14 +513,14 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
|
||||
foreach ($bettypes as $bettype) {
|
||||
$total_bettype = array_sum(array_column($results, 'asp_teorica_'.$bettype));
|
||||
$total_bettype = array_sum(array_column($results, 'asp_teorica_' . $bettype));
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
// Aspettativa per Player: AP = AT * ATR / TOT AT
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$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] = ($asp_team * $asp_team_riferimento) / $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = ($value['asp_teorica_'.$bettype] * $asp_team_riferimento) / $total_bettype;
|
||||
$results[$key]['asp_player_' . $bettype] = ($value['asp_teorica_' . $bettype] * $asp_team_riferimento) / $total_bettype;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user