From 6f9152bccfc7b84e012028082ef44d2ed522dfcd Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 14 Dec 2023 14:52:43 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=87=87=E9=9B=86=E6=98=AF=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E8=AE=BE=E5=A4=87=E9=87=8D=E8=BF=9E=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E8=AE=BE=E5=A4=87=E6=96=AD=E5=BC=80=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E7=9A=84=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/DataCollectController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/api/controller/DataCollectController.php b/app/api/controller/DataCollectController.php index 41262335..9dfdfe1d 100644 --- a/app/api/controller/DataCollectController.php +++ b/app/api/controller/DataCollectController.php @@ -59,38 +59,38 @@ class DataCollectController extends BaseApiController LandCollection::create($data); // 设备告警 - $monitorThreshold = MonitorThreshold::find(); + $monitorThreshold = (new MonitorThreshold())->select()->toArray()[0]; // 风速告警 if ($payload['wind_speed'] > $monitorThreshold['wind_speed_max']) { - self::createAlarm($land[3], $device[1], 'wind_speed', '风速偏快' ,$payload['wind_speed']); + self::createAlarm($land[3], $device[1], '风速', '风速偏快' ,$payload['wind_speed']); } // ambient_temperature 环境温度 if ($payload['ambient_temperature'] < $monitorThreshold['air_temp_min']) { - self::createAlarm($land[3], $device[1], 'ambient_temperature', '气温偏低' ,$payload['ambient_temperature']); + self::createAlarm($land[3], $device[1], '环境温度', '气温偏低' ,$payload['ambient_temperature']); } // ambient_temperature 环境温度 if ($payload['ambient_temperature'] > $monitorThreshold['air_temp_max']) { - self::createAlarm($land[3], $device[1], 'ambient_temperature', '气温偏高' ,$payload['ambient_temperature']); + self::createAlarm($land[3], $device[1], '环境温度', '气温偏高' ,$payload['ambient_temperature']); } // ambient_humidity 环境湿度 if ($payload['ambient_humidity'] < $monitorThreshold['air_mois_min']) { - self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气湿度偏低' ,$payload['ambient_humidity']); + self::createAlarm($land[3], $device[1], '环境湿度', '环境湿度偏低' ,$payload['ambient_humidity']); } // ambient_humidity 环境湿度 if ($payload['ambient_humidity'] < $monitorThreshold['air_mois_max']) { - self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气湿度偏高' ,$payload['ambient_humidity']); + self::createAlarm($land[3], $device[1], '环境湿度', '环境湿度偏高' ,$payload['ambient_humidity']); } // carbon_dioxide 二氧化碳含量 if ($payload['carbon_dioxide'] > $monitorThreshold['air_co2_content_max']) { - self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气二氧化碳含量偏高' ,$payload['carbon_dioxide']); + self::createAlarm($land[3], $device[1], '二氧化碳含量', '空气二氧化碳含量偏高' ,$payload['carbon_dioxide']); } // carbon_dioxide 二氧化碳含量 if ($payload['carbon_dioxide'] < $monitorThreshold['air_co2_content_min']) { - self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气二氧化碳含量偏低' ,$payload['carbon_dioxide']); + self::createAlarm($land[3], $device[1], '二氧化碳含量', '空气二氧化碳含量偏低' ,$payload['carbon_dioxide']); } // ambient_air_pressure 大气压力