调整报警内容
parent
4f5ce5642d
commit
31a296f98a
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue