- Fix division by 0
This commit is contained in:
parent
6ab3fb014c
commit
82ab102ec7
1 changed files with 5 additions and 1 deletions
|
|
@ -26,7 +26,11 @@ class DashboardController extends Controller
|
|||
|
||||
// Données calculées à afficher
|
||||
$totalParticipation = Participation::count();
|
||||
$avgParticipUser = round($totalParticipation / count($participationsUnique), 1);
|
||||
if (count($participationsUnique) > 0){
|
||||
$avgParticipUser = round($totalParticipation / count($participationsUnique), 1);
|
||||
} else {
|
||||
$avgParticipUser = 0;
|
||||
}
|
||||
|
||||
// Tableau des dates comprises dans la table participation
|
||||
foreach ($participations as $participation)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue