clean: rewrite condition to prevent division by zero
This commit is contained in:
parent
f27ed8f354
commit
2bd16742dd
1 changed files with 1 additions and 5 deletions
|
|
@ -136,11 +136,7 @@ final class StatsHelper
|
|||
->whereDate('created_at', '<=', $end)
|
||||
->count();
|
||||
|
||||
if (!$employee) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return round($registered / $employee * 100, 2);
|
||||
return $employee ? round($registered / $employee * 100, 2) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue