Jing Li 2024-01-29 15:08:59 +08:00
parent 9b6581cdce
commit b18925675c
1 changed files with 35 additions and 31 deletions

View File

@ -246,7 +246,10 @@ class DeviceController extends Controller
} }
for ($i = 5; $i >= 0; $i--) { for ($i = 5; $i >= 0; $i--) {
$_key = now()->subHours($i)->format('Y-m-d H').':00:00'; $_key = now()->subHours($i)->format('Y-m-d H').':00:00';
$data[$device->monitoring_point][$_key] = null;
$data[$device->monitoring_point][$_key] = $_dataList[$_key][$deviceColumn] ?? null;
if ($device->supplier_key === 'device-supplier-linkos') {
if (isset($_dataList[$_key])) { if (isset($_dataList[$_key])) {
if($deviceColumn == 'ph'){ if($deviceColumn == 'ph'){
$data[$device->monitoring_point][$_key] = 7.49; $data[$device->monitoring_point][$_key] = 7.49;
@ -281,6 +284,7 @@ class DeviceController extends Controller
} }
} }
} }
}
break; break;
} }