This commit is contained in:
salam committed 2026-10-31 21:41:03 +01:00
1 parent 121a16bd79
commit 43013d3eec
2 files changed
+12 -2

No files matched your search

+2 -1
View File
@@ -16,11 +16,12 @@ trait CopyData
return; return;
} }
$copystring = "Part 1\n"; $copystring = '';
foreach ($this->calculationVariables as $k => $part) { foreach ($this->calculationVariables as $k => $part) {
foreach ($part as $row) { foreach ($part as $row) {
if ($copystring == '') { if ($copystring == '') {
$copystring = "Part 1\n";
$keys = array_keys($row); $keys = array_keys($row);
$copystring .= implode(';', $keys)."\n"; $copystring .= implode(';', $keys)."\n";
} }
+10 -1
View File
@@ -24,7 +24,7 @@ trait PlayerQuery
$this->season_selected = $this->getCurrentSeason(); $this->season_selected = $this->getCurrentSeason();
} }
Log::debug('season_selected', $this->season_selected); // Log::debug('home_id away_id', [$this->home_id, $this->away_id]);
$matches_ids = match ($part) { $matches_ids = match ($part) {
1 => StatistikoEvent::where('league_id', $this->liga_id) 1 => StatistikoEvent::where('league_id', $this->liga_id)
@@ -50,8 +50,11 @@ trait PlayerQuery
}; };
} }
Log::debug('matches_ids', $matches_ids);
$res = StatistikoPlayer::with('details')->whereIn('ss_player_id', $player_ids)->whereIn('match_id', $matches_ids)->get(); $res = StatistikoPlayer::with('details')->whereIn('ss_player_id', $player_ids)->whereIn('match_id', $matches_ids)->get();
$arr = []; $arr = [];
$count = 0;
foreach ($res as $val) { foreach ($res as $val) {
$ss_player_id = (int) $val->ss_player_id; $ss_player_id = (int) $val->ss_player_id;
@@ -60,6 +63,10 @@ trait PlayerQuery
$home_id = (int) $val->event->home_id; $home_id = (int) $val->event->home_id;
$away_id = (int) $val->event->away_id; $away_id = (int) $val->event->away_id;
if ($ss_player_id == 1200574) {
$count++;
}
if (! isset($arr[$ss_player_id])) { if (! isset($arr[$ss_player_id])) {
self::array_template($arr, $ss_player_id); self::array_template($arr, $ss_player_id);
} }
@@ -92,6 +99,8 @@ trait PlayerQuery
$arr[$ss_player_id]['was_fouled'] += $val->was_fouled; $arr[$ss_player_id]['was_fouled'] += $val->was_fouled;
} }
// Log::debug('count 1200574', [$part => $count]);
foreach ($players as $player) { foreach ($players as $player) {
if (isset($arr[$player->ss_player_id])) { if (isset($arr[$player->ss_player_id])) {
$arr[$player->ss_player_id]['position'] = $player->position; $arr[$player->ss_player_id]['position'] = $player->position;