feat: suivre la température pendant les tournées
This commit is contained in:
parent
68590eddbb
commit
d35434c522
15 changed files with 129 additions and 23 deletions
|
|
@ -704,6 +704,21 @@ trait AnimalBrowseActions
|
|||
$weightsStmt->execute([':id' => $id]);
|
||||
$weights = $weightsStmt->fetchAll();
|
||||
|
||||
$temperaturesStmt = $db->prepare("
|
||||
SELECT measured_at, value FROM (
|
||||
SELECT noted_at AS measured_at, temperature_c AS value
|
||||
FROM medical_notes
|
||||
WHERE animal_id = :medical_id AND temperature_c IS NOT NULL
|
||||
UNION ALL
|
||||
SELECT observation.checked_at AS measured_at, observation.temperature_c AS value
|
||||
FROM care_round_observations observation
|
||||
WHERE observation.animal_id = :round_id AND observation.temperature_c IS NOT NULL
|
||||
)
|
||||
ORDER BY datetime(measured_at) ASC
|
||||
");
|
||||
$temperaturesStmt->execute([':medical_id' => $id, ':round_id' => $id]);
|
||||
$temperatures = $temperaturesStmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$stmt = $db->prepare("
|
||||
SELECT value
|
||||
FROM measurements
|
||||
|
|
@ -952,6 +967,7 @@ trait AnimalBrowseActions
|
|||
'adopters' => $adopters,
|
||||
'death' => $death,
|
||||
'weights' => $weights,
|
||||
'temperatures' => $temperatures,
|
||||
'lastWeight' => $lastWeight,
|
||||
'prevWeight' => $prevWeight,
|
||||
'photos' => $photos,
|
||||
|
|
|
|||
Loading…
Reference in a new issue