This commit is contained in:
salam committed 2026-09-14 19:16:51 +02:00
1 parent 093d8b4740
commit 3a430e1a73
2 files changed
+35 -18

No files matched your search

+22 -5
View File
@@ -20,17 +20,29 @@ class PlayerPropsDrop extends Widget
protected string $view = 'livewire.player-props-drop'; protected string $view = 'livewire.player-props-drop';
public float $x_value = 3; public float $x_value = 3;
public float $y_value = 180; public float $y_value = 180;
public array $activeBoxes; public array $activeBoxes;
public array $beschriftung; public array $beschriftung;
public array $lineup; public array $lineup;
public array $lineUpMap; public array $lineUpMap;
public string $activeLineUp; public string $activeLineUp;
public array $boxes; public array $boxes;
public string $team_name = ''; public string $team_name = '';
public int $team_id = 0; public int $team_id = 0;
public int $match_id; public int $match_id;
public int $player_on_field_counter; public int $player_on_field_counter;
public array $calculationVariables; public array $calculationVariables;
public array $players; public array $players;
@@ -241,6 +253,7 @@ class PlayerPropsDrop extends Widget
Notification::make()->title('Needs a calculation first ') Notification::make()->title('Needs a calculation first ')
->info() ->info()
->send(); ->send();
return; return;
} }
@@ -266,6 +279,7 @@ class PlayerPropsDrop extends Widget
Notification::make()->title('Needs a calculation first ') Notification::make()->title('Needs a calculation first ')
->info() ->info()
->send(); ->send();
return; return;
} }
$header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd']; $header = ['name', 'foot', 'events', 'average min', 'position', 'on field', 'gls', 'fls', 'ofs', 'snt', 'tsh', 'crd'];
@@ -333,14 +347,18 @@ class PlayerPropsDrop extends Widget
$player = StatistikoDetail::where('ss_team_id', (int) $team_id)->where('is_active', 1)->get(); $player = StatistikoDetail::where('ss_team_id', (int) $team_id)->where('is_active', 1)->get();
// dd($player); $count_player = 0;
foreach ($$player as $key => $value) {
if ($value['position'] != 'GK') {
$count_player++;
}
}
// Aspettativa Team di Riferimento // Aspettativa Team di Riferimento
// (ATR) = Aspettativa Team * Numero di Giocatori di Team in Rosters (esclusi i portieri) / 10. // (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 // Ad esempio per Remo (supponiamo 24 giocatori nel Roster esclusi i portieri): ATR = 1.2 * 24 / 10 = 2.88
$asp_team_riferimento = (float) $asp_team * $count_player / 10;
$asp_team_riferimento = (float) $asp_team * $player->count() / 10;
// dd($player->count(), $asp_team_riferimento); // dd($player->count(), $asp_team_riferimento);
@@ -379,6 +397,7 @@ class PlayerPropsDrop extends Widget
$tmp['asp_team'] = $asp_team; $tmp['asp_team'] = $asp_team;
$tmp['asp_team_riferimento'] = $asp_team_riferimento; $tmp['asp_team_riferimento'] = $asp_team_riferimento;
$tmp['team_without_gk'] = $count_player;
$position_field = $this->get_position($ss_player_id); $position_field = $this->get_position($ss_player_id);
if ($position_field) { if ($position_field) {
@@ -482,7 +501,6 @@ class PlayerPropsDrop extends Widget
// Aspettativa per Player: AP = AT * ATR / TOT AT // Aspettativa per Player: AP = AT * ATR / TOT AT
$results[] = $tmp; $results[] = $tmp;
// for dev copy // for dev copy
$this->calculationVariables[] = $tmp; $this->calculationVariables[] = $tmp;
} }
@@ -490,7 +508,6 @@ class PlayerPropsDrop extends Widget
Log::debug('results', $results); Log::debug('results', $results);
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target']; $bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
foreach ($bettypes as $bettype) { foreach ($bettypes as $bettype) {
$total_bettype = array_sum(array_column($results, 'asp_teorica_'.$bettype)); $total_bettype = array_sum(array_column($results, 'asp_teorica_'.$bettype));
Generated
+13 -13
View File
@@ -5269,16 +5269,16 @@
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v5.8.0", "version": "v5.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def",
"reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5320,9 +5320,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0"
}, },
"time": "2026-07-04T14:30:18+00:00" "time": "2026-09-13T18:51:52+00:00"
}, },
{ {
"name": "nunomaduro/termwind", "name": "nunomaduro/termwind",
@@ -12685,21 +12685,21 @@
}, },
{ {
"name": "rector/rector", "name": "rector/rector",
"version": "2.6.6", "version": "2.6.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/rectorphp/rector.git", "url": "https://github.com/rectorphp/rector.git",
"reference": "ca069d6c79feaa6651b423c15d101a27a436093e" "reference": "f4aa224edb9b0630fb43826d4cb6a49b62e48d4c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/ca069d6c79feaa6651b423c15d101a27a436093e", "url": "https://api.github.com/repos/rectorphp/rector/zipball/f4aa224edb9b0630fb43826d4cb6a49b62e48d4c",
"reference": "ca069d6c79feaa6651b423c15d101a27a436093e", "reference": "f4aa224edb9b0630fb43826d4cb6a49b62e48d4c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.4|^8.0", "php": "^7.4|^8.0",
"phpstan/phpstan": "^2.2.10" "phpstan/phpstan": "^2.2.14"
}, },
"conflict": { "conflict": {
"rector/rector-doctrine": "*", "rector/rector-doctrine": "*",
@@ -12730,7 +12730,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/rectorphp/rector/issues", "issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.6.6" "source": "https://github.com/rectorphp/rector/tree/2.6.7"
}, },
"funding": [ "funding": [
{ {
@@ -12738,7 +12738,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-09-02T09:38:46+00:00" "time": "2026-09-13T20:17:44+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",