fix: detecciones redis
This commit is contained in:
parent
ec446beaf8
commit
14b1fb65d0
@ -194,8 +194,7 @@ public function deteccionesDelDia(Request $request, int $id)
|
||||
// Filtrar solo VIN, placa, antena y si es robado
|
||||
$deteccionesFiltradas = array_map(function($deteccion) {
|
||||
return [
|
||||
'tid' => $deteccion['fast_id'] ?? null,
|
||||
'vin' => $deteccion['vin'] ?? null,
|
||||
'vin' => $deteccion['fast_id'] ?? null,
|
||||
'placa' => $deteccion['placa'] ?? null,
|
||||
'antena' => $deteccion['antena'] ?? null,
|
||||
'robado' => $deteccion['tiene_reporte_robo'] ?? false,
|
||||
|
||||
@ -281,6 +281,9 @@ private function registrarDeteccionDelDia(string $fastId, array $vehiculo, ?int
|
||||
$timestamp = now()->timestamp;
|
||||
$key = "deteccion:dia:{$fecha}:{$fastId}:{$timestamp}";
|
||||
|
||||
// Obtener nombre del arco
|
||||
$arcoNombre = $arcoId ? Arco::find($arcoId)?->nombre : null;
|
||||
|
||||
$datosDeteccion = [
|
||||
'fast_id' => $fastId,
|
||||
'vin' => $vehiculo['vin'] ?? null,
|
||||
@ -289,6 +292,7 @@ private function registrarDeteccionDelDia(string $fastId, array $vehiculo, ?int
|
||||
'modelo' => $vehiculo['modelo'] ?? null,
|
||||
'color' => $vehiculo['color'] ?? null,
|
||||
'arco_id' => $arcoId,
|
||||
'arco_nombre' => $arcoNombre,
|
||||
'antena' => $antena,
|
||||
'estado' => $resultado['estado'] ?? 'LIBRE',
|
||||
'tiene_reporte_robo' => $resultado['tiene_reporte_robo'] ?? false,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user