This commit is contained in:
salam committed 2026-10-15 16:46:13 +02:00
1 parent 55f31acf2a
commit c8858574c1
2 files changed
+12 -6

No files matched your search

+4 -3
View File
@@ -97,10 +97,11 @@ class PlayerProps extends Page implements HasForms
} }
#[On('team-update')] #[On('team-update')]
public function syncData() public function syncData($team_id)
{ {
if ($this->team_id) { if ($team_id) {
$this->clientLineUps = SsLineupMemory::where('team_id', $this->team_id)->where('client_id', Auth::user()->client_id)->pluck('lineup')->toArray(); $this->team_id = $team_id;
$this->clientLineUps = SsLineupMemory::where('team_id', $team_id)->where('client_id', Auth::user()->client_id)->pluck('lineup')->toArray();
} else { } else {
$this->players = []; $this->players = [];
$this->dispatch('clear-all'); $this->dispatch('clear-all');
+8 -3
View File
@@ -97,6 +97,7 @@ class PlayerPropsDrop extends Widget
{ {
$this->team_name = ''; $this->team_name = '';
$this->match_id = 0; $this->match_id = 0;
$this->team_id = 0;
for ($i = 1; $i <= 35; $i++) { for ($i = 1; $i <= 35; $i++) {
$this->boxes[$i] = []; $this->boxes[$i] = [];
} }
@@ -124,12 +125,12 @@ class PlayerPropsDrop extends Widget
{ {
$this->team_id = $team_id; $this->team_id = $team_id;
$this->syncData(); $this->syncData($team_id);
} }
public function syncData() public function syncData(int $team_id)
{ {
if ($this->team_id) { if ($team_id) {
$this->players = []; $this->players = [];
$positions_map = LoadPositions::load(); $positions_map = LoadPositions::load();
@@ -503,6 +504,10 @@ class PlayerPropsDrop extends Widget
return; return;
} }
if (! $this->team_id && ! $this->match_id) {
return;
}
// Log::info($this->team_id, ['calculateAspg']); // Log::info($this->team_id, ['calculateAspg']);
// Calcolare Aspettativa Team per GOALS // Calcolare Aspettativa Team per GOALS
// (il valore che appare quando viene selezionato un Evento): nell' esempio, // (il valore che appare quando viene selezionato un Evento): nell' esempio,