Răsfoiți Sursa

Si commentaire mais pas de note, note non comptée

François 6 ani în urmă
părinte
comite
62a768909f
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      src/AppBundle/Service/NoteMoyenne.php

+ 2 - 1
src/AppBundle/Service/NoteMoyenne.php

@@ -27,7 +27,8 @@ class NoteMoyenne {
         $nb = 0;
         $nb = 0;
 
 
         foreach ($commentaires as $commentaire) {
         foreach ($commentaires as $commentaire) {
-            $nb ++;
+            if ($commentaire->getNote() > 0 && $commentaire->getNote() != null)
+                $nb++;
             $total += $commentaire->getNote();
             $total += $commentaire->getNote();
         }
         }