Skip to content

Commit

Permalink
Merge pull request #178 from andig/fix-bigint-conversion
Browse files Browse the repository at this point in the history
Avoid timestamp casted to string
  • Loading branch information
jahir committed Sep 4, 2014
2 parents 32f7749 + 4bd7777 commit 65777a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Volkszaehler/Interpreter/Interpreter.php
Expand Up @@ -130,13 +130,13 @@ protected function getData() {
$sql = 'SELECT MIN(timestamp) FROM (SELECT timestamp FROM data WHERE channel_id=? AND timestamp<? ORDER BY timestamp DESC LIMIT 2) t';
$from = $this->conn->fetchColumn($sql, array($this->channel->getId(), $this->from), 0);
if ($from)
$this->from = $from;
$this->from = (double)$from; // bigint conversion
}
if (isset($this->to)) {
$sql = 'SELECT MAX(timestamp) FROM (SELECT timestamp FROM data WHERE channel_id=? AND timestamp>? ORDER BY timestamp ASC LIMIT 2) t';
$to = $this->conn->fetchColumn($sql, array($this->channel->getId(), $this->to), 0);
if ($to)
$this->to = $to;
$this->to = (double)$to; // bigint conversion
}
}

Expand Down

0 comments on commit 65777a2

Please sign in to comment.