|
@@ -28,6 +28,14 @@ class Point extends Model
|
|
|
return $this->hasOne(Note::class, 'id', 'last_child_plan_point_scoped_note_id');
|
|
|
}
|
|
|
|
|
|
+ public static function getGlobalSingletonOfCategory(Client $_patient, String $_category) {
|
|
|
+ return Point
|
|
|
+ ::where('client_id', $_patient->id)
|
|
|
+ ->where('category', $_category)
|
|
|
+ ->orderBy('created_at', 'DESC')
|
|
|
+ ->first();
|
|
|
+ }
|
|
|
+
|
|
|
public static function getIntakePointsOfCategory(Client $_patient, String $_category, Note $_note) {
|
|
|
$points = Point
|
|
|
::where('client_id', $_patient->id)
|