调整报警内容
parent
4f5ce5642d
commit
31a296f98a
|
|
@ -147,17 +147,18 @@ class DeviceWarningService
|
||||||
$msg = $fieldNameMap[$column].'达到'.($log->$column ?? 0).$fieldUnitMap[$column].'值';
|
$msg = $fieldNameMap[$column].'达到'.($log->$column ?? 0).$fieldUnitMap[$column].'值';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($msg){
|
||||||
$notices[] = [
|
$notices[] = [
|
||||||
'device_id' => $device->id,
|
'device_id' => $device->id,
|
||||||
'lv' => $lv,
|
'lv' => $lv,
|
||||||
'content' => '【'.$device->name.'】【'.WarningNotice::lvMap()[$lv].'】'.$msg,
|
'content' => '【'.$device->name.'】【'.WarningNotice::lvMap()[$lv].'】'.$msg,
|
||||||
'reported_at' => $reportedAt,
|
'reported_at' => $reportedAt,
|
||||||
'created_at' => now(),
|
'created_at' => now(),
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
'loggable_type' => $log::class,
|
'loggable_type' => $log::class,
|
||||||
'loggable_id' => $log->id,
|
'loggable_id' => $log->id,
|
||||||
];
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
count($notices) > 0 && WarningNotice::insert($notices);
|
count($notices) > 0 && WarningNotice::insert($notices);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue