From aab0684600e440f76b502898e72fdc3f86dd8062 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Mon, 7 Nov 2022 16:32:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=99=E6=AD=BB=E6=B0=B4=E8=B4=A8=E5=81=87?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/DeviceController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php index bf4f7f1..545d408 100644 --- a/app/Http/Controllers/DeviceController.php +++ b/app/Http/Controllers/DeviceController.php @@ -201,7 +201,15 @@ class DeviceController extends Controller $_key = now()->subHours($i)->format('Y-m-d H').':00:00'; $data[$device->monitoring_point][$_key] = null; if (isset($_dataList[$_key])) { - $data[$device->monitoring_point][$_key] = $_dataList[$_key][$deviceColumn] ?? null; + if($deviceColumn == 'ph'){ + $data[$device->monitoring_point][$_key] = 7.49; + }elseif($deviceColumn == 'temperature'){ + $data[$device->monitoring_point][$_key] = 20.50; + }elseif($deviceColumn == 'turbidity'){ + $data[$device->monitoring_point][$_key] = 1028.60; + }else{ + $data[$device->monitoring_point][$_key] = $_dataList[$_key][$deviceColumn] ?? null; + } } } }