upload test, viac senzorov
This commit is contained in:
@@ -20,6 +20,7 @@ class StatisticsController extends Controller
|
||||
$startdate = $request->input('startdate',NULL);
|
||||
$enddate = $request->input('enddate',NULL);
|
||||
$range = $request->input('range',NULL);
|
||||
$host = $request->input('host','balkon');
|
||||
if (!in_array($type,$types)) $type = $types[0];
|
||||
if ($startdate == NULL || $startdate == '') $startdate = "now()-1d";
|
||||
else $startdate = sprintf("'%s'",Carbon::parse($startdate)->toDateTimeString());
|
||||
@@ -34,7 +35,7 @@ class StatisticsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$q = sprintf("select time,min(value),max(value),mean(value),last(value) from bme280_value where host='balkon' and type='%s' and time >= %s and time <= %s group by time(%s);",$type,$startdate,$enddate,$range);
|
||||
$q = sprintf("select time,min(value),max(value),mean(value),last(value) from bme280_value where host='%s' and type='%s' and time >= %s and time <= %s group by time(%s);",$host,$type,$startdate,$enddate,$range);
|
||||
\Debugbar::info($q);
|
||||
$result = \InfluxDB::query($q);
|
||||
$points = $result->getPoints();
|
||||
|
||||
Reference in New Issue
Block a user