This commit is contained in:
salam committed 2026-11-01 16:45:17 +01:00
1 parent 5d85f06da2
commit f3f0a5d815
3 files changed
+14 -15

No files matched your search

+3 -1
View File
@@ -174,7 +174,9 @@ class PlayerPropsDrop extends Widget
$this->generateLineUp(); $this->generateLineUp();
$this->calculateAspg(); // if ($this->player_on_field_counter >= 10) {
// $this->calculateAspg();
// }
} }
+2 -1
View File
@@ -4,6 +4,7 @@ namespace App\Traits\PlayerProps;
use App\Models\StatisticFixtures; use App\Models\StatisticFixtures;
use App\Models\StatistikoDetail; use App\Models\StatistikoDetail;
use Illuminate\Support\Facades\Log;
trait PlayerAspg trait PlayerAspg
{ {
@@ -29,7 +30,7 @@ trait PlayerAspg
return; return;
} }
// Log::debug('calculateAspg', $this->players); Log::debug('calculateAspg', $this->players);
// 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,
+9 -13
View File
@@ -88,7 +88,7 @@ trait PlayerQuery
} }
$arr = []; $arr = [];
$res = $this->getPlayers(1, $player_ids); $res = StatistikoPlayer::with('details')->whereIn('ss_player_id', $player_ids)->get();
foreach ($res as $val) { foreach ($res as $val) {
$ss_player_id = (int) $val->ss_player_id; $ss_player_id = (int) $val->ss_player_id;
$activeteam_id = (int) $val->activeteam_id; $activeteam_id = (int) $val->activeteam_id;
@@ -182,26 +182,22 @@ trait PlayerQuery
$this->season_selected = $this->getCurrentSeason(); $this->season_selected = $this->getCurrentSeason();
} }
$sesson_int_string = []; if ($this->season_mode == 'halftime') {
foreach ($this->season_selected as $value) { $this->season_selected = array_map('strval', $this->season_selected);
if (strpos($value, '/') !== false) { } else {
$sesson_int_string[] = (string) $value; $this->season_selected = array_map('intval', $this->season_selected);
} else {
$sesson_int_string[] = (string) $value;
$sesson_int_string[] = (int) $value;
}
} }
return match ($part) { return match ($part) {
1 => StatistikoPlayer::with('details') 1 => StatistikoPlayer::with('details')
->whereIn('ss_player_id', $player_ids) ->whereIn('ss_player_id', $player_ids)
->when($this->season_selected, function ($query) use ($sesson_int_string) { ->when($this->season_selected, function ($query) {
return $query->whereIn('season', $sesson_int_string); return $query->whereIn('season', $this->season_selected);
})->get(), })->get(),
2 => StatistikoPlayer::with('details') 2 => StatistikoPlayer::with('details')
->whereIn('ss_player_id', $player_ids) ->whereIn('ss_player_id', $player_ids)
->when($this->season_selected, function ($query) use ($sesson_int_string) { ->when($this->season_selected, function ($query) {
return $query->whereNotIn('season', $sesson_int_string); return $query->whereNotIn('season', $this->season_selected);
})->get(), })->get(),
}; };