From 9d4c528a3b047fc67535c2a8956394f9d5f571bc Mon Sep 17 00:00:00 2001
From: seb2903 <dseb@wanadoo.fr>
Date: Tue, 26 Mar 2024 10:57:05 +0100
Subject: [PATCH] correctif pour rechercher les evaluations precedentes

---
 app/Models/Evaluation.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/Models/Evaluation.php b/app/Models/Evaluation.php
index 9c0908bd..d92b31eb 100644
--- a/app/Models/Evaluation.php
+++ b/app/Models/Evaluation.php
@@ -178,7 +178,7 @@ public function saveAutomaticAnswers()
                  */
                 $previousEvaluation = Evaluation::where('status', Evaluation::STATUS_DONE)
                     ->where('organization_id', $this->organization_id)
-                    ->whereDate('updated_at', '<', $this->updated_at->toDateTime())
+                    ->where('updated_at', '<', $this->updated_at)
                     ->orderBy('updated_at', 'DESC')
                     ->first();
                 $calculated_level = MaturityAnswerLevelCalculator::calculateExecutionLevel($this, $previousEvaluation);
-- 
GitLab