wip
This commit is contained in:
1 parent
a2e86a2419
commit
2f4f0c412b
2 files changed
+91
-90
No files matched your search
@@ -96,7 +96,6 @@ class PlayerPropsDrop extends Widget
|
||||
$this->match_id = $match_id;
|
||||
}
|
||||
$this->dispatch('update-players', players: $this->players);
|
||||
|
||||
}
|
||||
|
||||
#[On('team-update')]
|
||||
@@ -297,9 +296,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`)");
|
||||
|
||||
@@ -319,7 +318,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'];
|
||||
@@ -339,7 +338,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`)");
|
||||
|
||||
@@ -408,7 +407,7 @@ class PlayerPropsDrop extends Widget
|
||||
"shots_on_target" => 3
|
||||
"shots_off_target" => 2
|
||||
"total_shots" => 4
|
||||
*/
|
||||
*/
|
||||
|
||||
$ss_player_id = $val->ss_player_id;
|
||||
$position = $val->details->position;
|
||||
@@ -454,8 +453,8 @@ 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':
|
||||
@@ -464,8 +463,8 @@ class PlayerPropsDrop extends Widget
|
||||
} 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) {
|
||||
@@ -473,8 +472,8 @@ class PlayerPropsDrop extends Widget
|
||||
} 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) {
|
||||
@@ -482,8 +481,8 @@ class PlayerPropsDrop extends Widget
|
||||
} 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) {
|
||||
@@ -491,8 +490,8 @@ class PlayerPropsDrop extends Widget
|
||||
} 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) {
|
||||
@@ -500,8 +499,8 @@ class PlayerPropsDrop extends Widget
|
||||
} 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) {
|
||||
@@ -509,8 +508,8 @@ class PlayerPropsDrop extends Widget
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
@@ -531,7 +530,7 @@ 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) {
|
||||
switch ($bettype) {
|
||||
@@ -542,38 +541,38 @@ class PlayerPropsDrop extends Widget
|
||||
|
||||
$asp_team_riferimento = (float) $asp_team * $count_player / 10;
|
||||
$results[$key]['asp_riferimento_goals'] = $asp_team_riferimento;
|
||||
$results[$key]['asp_total_'.$bettype] = $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;
|
||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
||||
break;
|
||||
case 'cards':
|
||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['crd'] * $count_player / 10;
|
||||
$results[$key]['asp_team_riferimento_card'] = $asp_team_riferimento;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
||||
break;
|
||||
case 'fouls':
|
||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['fls'] * $count_player / 10;
|
||||
$results[$key]['asp_team_riferimento_fouls'] = $asp_team_riferimento;
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
||||
break;
|
||||
case 'offsides':
|
||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['ofs'] * $count_player / 10;
|
||||
$results[$key]['asp_team_riferimento_offside'] = $asp_team_riferimento;
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
||||
break;
|
||||
case 'total_shots':
|
||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['tsh'] * $count_player / 10;
|
||||
$results[$key]['asp_team_riferimento_tsh'] = $asp_team_riferimento;
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
||||
break;
|
||||
case 'shots_on_target':
|
||||
$asp_team_riferimento = (float) $asp_team_all[$team_home_away]['snt'] * $count_player / 10;
|
||||
$results[$key]['asp_team_riferimento_snt'] = $asp_team_riferimento;
|
||||
$results[$key]['asp_total_'.$bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_'.$bettype] = $value['asp_teorica_'.$bettype] * $asp_team_riferimento / $total_bettype;
|
||||
$results[$key]['asp_total_' . $bettype] = $total_bettype;
|
||||
$results[$key]['asp_player_' . $bettype] = $value['asp_teorica_' . $bettype] * $asp_team_riferimento / $total_bettype;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user