Jelajahi Sumber

fixed sticky note info

= 3 tahun lalu
induk
melakukan
6fbcadcc1e

+ 7 - 0
app/Models/Client.php

@@ -108,6 +108,13 @@ class Client extends Model
         return $this->hasOne(Pro::class, 'id', 'default_na_pro_id');
     }
 
+    public function stickyNoteUpdatedBySession()
+    {
+        return $this->hasOne(AppSession::class, 'id', 'sticky_note_updated_by_session_id');
+    }
+
+    
+
     public function creator()
     {
         return $this->hasOne(Pro::class, 'id', 'created_by_pro_id');

+ 1 - 1
resources/views/layouts/patient-header.blade.php

@@ -495,7 +495,7 @@ $addressParts .= implode(", ", $addressPart2);
         <div class="">
           <span class="d-block text-secondary">{{$patient->sticky_note ?? '-' }}</span>
           <div>
-            <small class="text-muted">By: {{ $patientRecentStickyNote->createdBy->pro->displayName()  }} • At: {{ friendlier_date($patientRecentStickyNote->created_at) }}</small>
+            <small class="text-muted">By: {{ $patient->stickyNoteUpdatedBySession? $patient->stickyNoteUpdatedBySession->pro->displayName() : '-'  }} • At: {{ friendlier_date($patient->sticky_note_updated_at) }}</small>
           </div>
         </div>
         @endif