mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-25 06:53:00 +00:00
[server] Bugfix: Filter result of device-data action by reading type
This commit is contained in:
parent
25ab294d1c
commit
ee6cf4a86e
1 changed files with 3 additions and 0 deletions
|
@ -131,6 +131,8 @@ class MariaDBMeasurementDataRepository implements IMeasurementDataRepository {
|
||||||
{$s("table_name_metadata")}.{$s("column_metadata_id")} = {$s("table_name_values")}.{$s("column_values_reading_id")}
|
{$s("table_name_metadata")}.{$s("column_metadata_id")} = {$s("table_name_values")}.{$s("column_values_reading_id")}
|
||||||
WHERE
|
WHERE
|
||||||
{$s("table_name_metadata")}.{$s("column_metadata_device_id")} = :device_id AND
|
{$s("table_name_metadata")}.{$s("column_metadata_device_id")} = :device_id AND
|
||||||
|
{$s("table_name_values")}.{$s("column_values_reading_type")} = :reading_type AND
|
||||||
|
|
||||||
COALESCE(
|
COALESCE(
|
||||||
{$s("table_name_metadata")}.{$s("column_metadata_recordedon")},
|
{$s("table_name_metadata")}.{$s("column_metadata_recordedon")},
|
||||||
{$s("table_name_metadata")}.{$s("column_metadata_storedon")}
|
{$s("table_name_metadata")}.{$s("column_metadata_storedon")}
|
||||||
|
@ -144,6 +146,7 @@ class MariaDBMeasurementDataRepository implements IMeasurementDataRepository {
|
||||||
{$s("table_name_metadata")}.{$s("column_metadata_storedon")}
|
{$s("table_name_metadata")}.{$s("column_metadata_storedon")}
|
||||||
)) / :average_seconds);", [
|
)) / :average_seconds);", [
|
||||||
"device_id" => $device_id,
|
"device_id" => $device_id,
|
||||||
|
"reading_type" => $reading_type,
|
||||||
"start_datetime" => $start->format(\DateTime::ISO8601),
|
"start_datetime" => $start->format(\DateTime::ISO8601),
|
||||||
"end_datetime" => $end->format(\DateTime::ISO8601),
|
"end_datetime" => $end->format(\DateTime::ISO8601),
|
||||||
"average_seconds" => $average_seconds
|
"average_seconds" => $average_seconds
|
||||||
|
|
Loading…
Reference in a new issue