mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-12-22 10:25:01 +00:00
Fix measurement data query (I think)
This commit is contained in:
parent
9f6bea64d4
commit
102bd13864
1 changed files with 4 additions and 2 deletions
|
@ -12,7 +12,7 @@ class MariaDBMeasurementDataRepository implements IMeasurementDataRepository {
|
|||
public static $column_values_id = "id";
|
||||
public static $column_values_reading_id = "reading_id";
|
||||
public static $column_values_value = "value";
|
||||
public static $column_values_reading_value_types_id = "reading_value_types_id";
|
||||
public static $column_values_reading_type = "reading_value_types_id";
|
||||
|
||||
public static $column_metadata_id = "id";
|
||||
public static $column_metadata_storedon = "storedon";
|
||||
|
@ -67,7 +67,9 @@ class MariaDBMeasurementDataRepository implements IMeasurementDataRepository {
|
|||
WHERE COALESCE(
|
||||
{$s("table_name_metadata")}.{$s("column_metadata_recordedon")},
|
||||
{$s("table_name_metadata")}.{$s("column_metadata_storedon")}
|
||||
) = :datetime", [
|
||||
) = :datetime AND
|
||||
{$s("table_name_values")}.{$s("column_values_reading_type")} = :reading_type
|
||||
", [
|
||||
// The database likes strings, not PHP DateTime() instances
|
||||
"datetime" => $datetime->format(\DateTime::ISO8601),
|
||||
"reading_type" => $reading_type
|
||||
|
|
Loading…
Reference in a new issue