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 大气压力