1
0
Fork 0

调整报警内容

main
vine_liutk 2023-09-07 12:29:08 +08:00
parent 4f5ce5642d
commit 31a296f98a
1 changed files with 12 additions and 11 deletions

View File

@ -147,17 +147,18 @@ class DeviceWarningService
$msg = $fieldNameMap[$column].'达到'.($log->$column ?? 0).$fieldUnitMap[$column].'值';
}
}
$notices[] = [
'device_id' => $device->id,
'lv' => $lv,
'content' => '【'.$device->name.'】【'.WarningNotice::lvMap()[$lv].'】'.$msg,
'reported_at' => $reportedAt,
'created_at' => now(),
'updated_at' => now(),
'loggable_type' => $log::class,
'loggable_id' => $log->id,
];
if($msg){
$notices[] = [
'device_id' => $device->id,
'lv' => $lv,
'content' => '【'.$device->name.'】【'.WarningNotice::lvMap()[$lv].'】'.$msg,
'reported_at' => $reportedAt,
'created_at' => now(),
'updated_at' => now(),
'loggable_type' => $log::class,
'loggable_id' => $log->id,
];
}
}
count($notices) > 0 && WarningNotice::insert($notices);