EnterScore action working to add a total score when a score is saved by a judge.
This commit is contained in:
parent
e6da41d1d9
commit
e47265badd
|
|
@ -106,11 +106,12 @@ class EnterScore
|
|||
'sheet_total' => ($scoreSheetTotal / $maxPossible) * 100,
|
||||
]);
|
||||
} else {
|
||||
$finalTotal = ($scoreSheetTotal / $maxPossible) * 100;
|
||||
$scoreSheet = ScoreSheet::create([
|
||||
'user_id' => $user->id,
|
||||
'entry_id' => $entry->id,
|
||||
'subscores' => $subscoresStorageArray,
|
||||
'sheet_total' => ($scoreSheetTotal / $maxPossible) * 100,
|
||||
'sheet_total' => $finalTotal,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ class ScoreSheet extends Model
|
|||
'user_id',
|
||||
'entry_id',
|
||||
'subscores',
|
||||
'sheet_total',
|
||||
];
|
||||
|
||||
protected $casts = ['subscores' => 'json'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue