Erweiterte Spielerstatistiken: 7-Meter, Strafen, Spielzeit
Neue Metriken für Jugendhandball: 7m-Würfe/-Tore, Gelbe Karten, 2-Minuten-Strafen und Spielzeit. Migration, Model, Controller, Views und Übersetzungen (6 Sprachen) vollständig implementiert. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,11 @@ class EventPlayerStat extends Model
|
||||
'goalkeeper_shots',
|
||||
'goals',
|
||||
'shots',
|
||||
'penalty_goals',
|
||||
'penalty_shots',
|
||||
'yellow_cards',
|
||||
'two_minute_suspensions',
|
||||
'playing_time_minutes',
|
||||
'note',
|
||||
];
|
||||
|
||||
@@ -27,6 +32,11 @@ class EventPlayerStat extends Model
|
||||
'goalkeeper_shots' => 'integer',
|
||||
'goals' => 'integer',
|
||||
'shots' => 'integer',
|
||||
'penalty_goals' => 'integer',
|
||||
'penalty_shots' => 'integer',
|
||||
'yellow_cards' => 'integer',
|
||||
'two_minute_suspensions' => 'integer',
|
||||
'playing_time_minutes' => 'integer',
|
||||
];
|
||||
|
||||
public function event(): BelongsTo
|
||||
@@ -63,6 +73,18 @@ class EventPlayerStat extends Model
|
||||
return round(($this->goals / $this->shots) * 100, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 7-Meter-Quote in Prozent.
|
||||
*/
|
||||
public function penaltyRate(): ?float
|
||||
{
|
||||
if (! $this->penalty_shots || $this->penalty_shots === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return round(($this->penalty_goals / $this->penalty_shots) * 100, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft ob der Eintrag leer ist (keine relevanten Daten).
|
||||
*/
|
||||
@@ -73,6 +95,11 @@ class EventPlayerStat extends Model
|
||||
&& ! $this->goalkeeper_shots
|
||||
&& ! $this->goals
|
||||
&& ! $this->shots
|
||||
&& ! $this->penalty_goals
|
||||
&& ! $this->penalty_shots
|
||||
&& ! $this->yellow_cards
|
||||
&& ! $this->two_minute_suspensions
|
||||
&& ! $this->playing_time_minutes
|
||||
&& ! $this->note;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user