浏览代码

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

François 6 年之前
父节点
当前提交
62a768909f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/AppBundle/Service/NoteMoyenne.php

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

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