This commit is contained in:
salam committed 2026-07-30 18:57:44 +02:00
1 parent c394f7afba
commit 44af3f2caa
21 files changed
+222 -151

No files matched your search

@@ -14,7 +14,7 @@ class PlayerPerSeason
{
$debug = Nuh::$options['d'] ?? 0;
$res = StatistikoDetail::query()->select('ss_player_id', 'txodds_id')->get();
$res = StatistikoDetail::query()->select('ss_player_id', 'ss_team_id')->get();
if ($debug) {
Notice::note('process ' . $res->count() . " player", 'bb');
@@ -35,10 +35,12 @@ class PlayerPerSeason
$collection[$val2->event->season]['minutes_played_away'] = 0;
}
if ($val2->minutes_played > 0) {
if ($val->txodds_id == $val2->event->home_id) {
if ($val2->activeteam_id == $val2->event->home_id) {
$collection[$val2->event->season]['events_played_home'] += 1;
$collection[$val2->event->season]['minutes_played_home'] += $val2->minutes_played;
} else if ($val->txodds_id == $val2->event->away_id) {
} else if ($val2->activeteam_id == $val2->event->away_id) {
$collection[$val2->event->season]['events_played_away'] += 1;
$collection[$val2->event->season]['minutes_played_away'] += $val2->minutes_played;
}
@@ -46,11 +48,11 @@ class PlayerPerSeason
}
foreach ($collection as $season => $row) {
if ($val->txodds_id && $val->ss_player_id) {
if ($val->ss_team_id && $val->ss_player_id) {
SofaScorePlayerPerSeason::updateOrCreate(
[
'ss_player_id' => $val->ss_player_id,
'tx_team_id' => $val->txodds_id,
'ss_team_id' => $val->ss_team_id,
'season' => $season
],
[