fixed bug for logging data
This commit is contained in:
parent
6fa845ed3e
commit
b2b6f357a9
1 changed files with 2 additions and 4 deletions
|
@ -53,18 +53,16 @@ class DataController extends Controller {
|
|||
$timestamp = $this->view->request->getParameter('ts');
|
||||
$value = $this->view->request->getParameter('value');
|
||||
|
||||
if (!$timestamp) {
|
||||
if (!is_null($timestamp)) {
|
||||
$timestamp = round(microtime(TRUE) * 1000);
|
||||
}
|
||||
|
||||
if (!$value) {
|
||||
if (!is_null($value)) {
|
||||
$value = 1;
|
||||
}
|
||||
|
||||
$data = new Model\Data($channel, $timestamp, $value);
|
||||
|
||||
$channel->addData($data);
|
||||
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue