|
@@ -1369,4 +1369,18 @@ ORDER BY cm.created_at DESC
|
|
|
return $this->activeClientReviewRequests->where('client_id', $clientID)->where('scoped_month_start_date', date('Y-m-01'))->first();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public function followupsScheduledForToday() {
|
|
|
+ return DB::select(DB::raw("
|
|
|
+SELECT crfu.id AS crfu_id,
|
|
|
+ crfu.next_follow_up_reason,
|
|
|
+ crfu.next_follow_up_memo,
|
|
|
+ c.uid as client_uid,
|
|
|
+ (c.name_first || ' ' || c.name_last) as client_name
|
|
|
+FROM client_rep_follow_up crfu join client c on crfu.id = c.client_rep_follow_up_id
|
|
|
+WHERE crfu.client_rep_pro_id = :pro_id
|
|
|
+ AND crfu.next_follow_up_date = :date
|
|
|
+ ORDER BY crfu.created_at DESC;
|
|
|
+ "), ["pro_id" => $this->id, 'date' => date('Y-m-d')]);
|
|
|
+ }
|
|
|
}
|