Răsfoiți Sursa

fixed note activity report

= 3 ani în urmă
părinte
comite
017b2b8d29
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      app/Http/Controllers/PracticeManagementController.php

+ 1 - 1
app/Http/Controllers/PracticeManagementController.php

@@ -829,7 +829,7 @@ class PracticeManagementController extends Controller
         ->selectRaw(" *,
             (SELECT id FROM note WHERE note.hcp_pro_id = pro.id AND is_cancelled = false ORDER BY created_at DESC LIMIT 1) as last_note_id, 
             (SELECT note.created_at FROM note WHERE note.hcp_pro_id = pro.id AND note.is_cancelled = false ORDER BY note.created_at DESC LIMIT 1) as last_note_created_at,
-            (SELECT COUNT(*) FROM note WHERE note.hcp_pro_id = pro.id AND note.is_cancelled = false AND created_at >= '${startOfCurrentMonth}'::DATE AND created_at <= '${endOfCurrentMonth}'::DATE ) AS notes_this_month,
+            (SELECT COUNT(*) FROM note WHERE note.hcp_pro_id = pro.id AND note.is_cancelled = false AND created_at::DATE >= '${startOfCurrentMonth}'::DATE AND created_at::DATE <= '${endOfCurrentMonth}'::DATE ) AS notes_this_month,
             (SELECT COUNT(*) FROM note WHERE note.hcp_pro_id = pro.id AND note.is_cancelled = false AND created_at >= '${from_date}'::DATE AND created_at <= '${to_date}'::DATE  ) AS notes_this_period");
         $rows = $rows->where('name_first', 'ilike', $wildCardedName)->orWhere('name_last', 'ilike', $wildCardedName);
         $rows = $rows->orderBy('name_first');