fixed invalid array indexes for min/max output
This commit is contained in:
parent
102716aa68
commit
d4c296ca34
1 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ class SensorInterpreter extends Interpreter {
|
|||
* @return array (0 => timestamp, 1 => value)
|
||||
*/
|
||||
public function getMin() {
|
||||
$min = $this->conn->fetchAssoc('SELECT value, timestamp FROM data WHERE channel_id = ?' . parent::buildDateTimeFilterSQL($this->from, $this->to) . ' ORDER BY value ASC LIMIT 1', array($this->channel->getId()));
|
||||
$min = $this->conn->fetchArray('SELECT timestamp, value FROM data WHERE channel_id = ?' . parent::buildDateTimeFilterSQL($this->from, $this->to) . ' ORDER BY value ASC LIMIT 1', array($this->channel->getId()));
|
||||
return ($min) ? array_map('floatval', $min) : NULL;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class SensorInterpreter extends Interpreter {
|
|||
* @return array (0 => timestamp, 1 => value)
|
||||
*/
|
||||
public function getMax() {
|
||||
$max = $this->conn->fetchAssoc('SELECT value, timestamp FROM data WHERE channel_id = ?' . parent::buildDateTimeFilterSQL($this->from, $this->to) . ' ORDER BY value DESC LIMIT 1', array($this->channel->getId()));
|
||||
$max = $this->conn->fetchArray('SELECT timestamp, value FROM data WHERE channel_id = ?' . parent::buildDateTimeFilterSQL($this->from, $this->to) . ' ORDER BY value DESC LIMIT 1', array($this->channel->getId()));
|
||||
return ($max) ? array_map('floatval', $max) : NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue