This commit is contained in:
salam committed 2026-09-14 15:33:18 +02:00
1 parent 93df72df43
commit 1064c40ac1
5 files changed
+714 -54

No files matched your search

+2
View File
@@ -26,6 +26,8 @@ class PlayerProps extends Page implements HasForms
protected string $view = 'filament.pages.player-props';
public static bool $shouldOpenNavigationUrlInNewTab = true;
protected static string|BackedEnum|null $navigationIcon = 'icon-soccerplayer';
public function getHeading(): string
+5 -9
View File
@@ -12,6 +12,7 @@ use App\Models\StatistikoDetail;
use Filament\Notifications\Notification;
use Filament\Widgets\Widget;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Livewire\Attributes\On;
class PlayerPropsDrop extends Widget
@@ -117,8 +118,6 @@ class PlayerPropsDrop extends Widget
}
}
public function loadPlacement()
{
$this->clearResultTable();
@@ -478,13 +477,15 @@ class PlayerPropsDrop extends Widget
// Aspettativa per Player: AP = AT * ATR / TOT AT
$results[] = $tmp;
// Log::debug('calc', $results);
// for dev copy
$this->calculationVariables[] = $tmp;
}
}
Log::debug('results', $results);
$bettypes = ['goals', 'cards', 'fouls', 'offsides', 'total_shots', 'shots_on_target'];
foreach ($bettypes as $bettype) {
$total_bettype = array_sum(array_column($results, 'asp_teorica_' . $bettype));
@@ -496,14 +497,9 @@ class PlayerPropsDrop extends Widget
}
}
// dd($results);
// update frontend
foreach ($this->players as $k => $record) {
foreach ($results as $key => $result) {
if ($record['id'] == $result['id']) {
// dd($result);
if ((int) $record['id'] == (int) $result['id']) {
$this->players[$k]['active'] = $result['active'];
$this->players[$k]['gls'] = number_format($result['asp_player_goals'], 3);
$this->players[$k]['fls'] = number_format($result['asp_player_fouls'], 3);