wip
This commit is contained in:
1 parent
5d85f06da2
commit
f3f0a5d815
3 files changed
+14
-15
No files matched your search
@@ -4,6 +4,7 @@ namespace App\Traits\PlayerProps;
|
||||
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoDetail;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
trait PlayerAspg
|
||||
{
|
||||
@@ -29,7 +30,7 @@ trait PlayerAspg
|
||||
return;
|
||||
}
|
||||
|
||||
// Log::debug('calculateAspg', $this->players);
|
||||
Log::debug('calculateAspg', $this->players);
|
||||
|
||||
// Calcolare Aspettativa Team per GOALS
|
||||
// (il valore che appare quando viene selezionato un Evento): nell' esempio,
|
||||
|
||||
@@ -88,7 +88,7 @@ trait PlayerQuery
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
$res = $this->getPlayers(1, $player_ids);
|
||||
$res = StatistikoPlayer::with('details')->whereIn('ss_player_id', $player_ids)->get();
|
||||
foreach ($res as $val) {
|
||||
$ss_player_id = (int) $val->ss_player_id;
|
||||
$activeteam_id = (int) $val->activeteam_id;
|
||||
@@ -182,26 +182,22 @@ trait PlayerQuery
|
||||
$this->season_selected = $this->getCurrentSeason();
|
||||
}
|
||||
|
||||
$sesson_int_string = [];
|
||||
foreach ($this->season_selected as $value) {
|
||||
if (strpos($value, '/') !== false) {
|
||||
$sesson_int_string[] = (string) $value;
|
||||
} else {
|
||||
$sesson_int_string[] = (string) $value;
|
||||
$sesson_int_string[] = (int) $value;
|
||||
}
|
||||
if ($this->season_mode == 'halftime') {
|
||||
$this->season_selected = array_map('strval', $this->season_selected);
|
||||
} else {
|
||||
$this->season_selected = array_map('intval', $this->season_selected);
|
||||
}
|
||||
|
||||
return match ($part) {
|
||||
1 => StatistikoPlayer::with('details')
|
||||
->whereIn('ss_player_id', $player_ids)
|
||||
->when($this->season_selected, function ($query) use ($sesson_int_string) {
|
||||
return $query->whereIn('season', $sesson_int_string);
|
||||
->when($this->season_selected, function ($query) {
|
||||
return $query->whereIn('season', $this->season_selected);
|
||||
})->get(),
|
||||
2 => StatistikoPlayer::with('details')
|
||||
->whereIn('ss_player_id', $player_ids)
|
||||
->when($this->season_selected, function ($query) use ($sesson_int_string) {
|
||||
return $query->whereNotIn('season', $sesson_int_string);
|
||||
->when($this->season_selected, function ($query) {
|
||||
return $query->whereNotIn('season', $this->season_selected);
|
||||
})->get(),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user