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
|
// Filtrar solo VIN, placa, antena y si es robado
|
||||||
$deteccionesFiltradas = array_map(function($deteccion) {
|
$deteccionesFiltradas = array_map(function($deteccion) {
|
||||||
return [
|
return [
|
||||||
'tid' => $deteccion['fast_id'] ?? null,
|
'vin' => $deteccion['fast_id'] ?? null,
|
||||||
'vin' => $deteccion['vin'] ?? null,
|
|
||||||
'placa' => $deteccion['placa'] ?? null,
|
'placa' => $deteccion['placa'] ?? null,
|
||||||
'antena' => $deteccion['antena'] ?? null,
|
'antena' => $deteccion['antena'] ?? null,
|
||||||
'robado' => $deteccion['tiene_reporte_robo'] ?? false,
|
'robado' => $deteccion['tiene_reporte_robo'] ?? false,
|
||||||
|
|||||||
@ -281,6 +281,9 @@ private function registrarDeteccionDelDia(string $fastId, array $vehiculo, ?int
|
|||||||
$timestamp = now()->timestamp;
|
$timestamp = now()->timestamp;
|
||||||
$key = "deteccion:dia:{$fecha}:{$fastId}:{$timestamp}";
|
$key = "deteccion:dia:{$fecha}:{$fastId}:{$timestamp}";
|
||||||
|
|
||||||
|
// Obtener nombre del arco
|
||||||
|
$arcoNombre = $arcoId ? Arco::find($arcoId)?->nombre : null;
|
||||||
|
|
||||||
$datosDeteccion = [
|
$datosDeteccion = [
|
||||||
'fast_id' => $fastId,
|
'fast_id' => $fastId,
|
||||||
'vin' => $vehiculo['vin'] ?? null,
|
'vin' => $vehiculo['vin'] ?? null,
|
||||||
@ -289,6 +292,7 @@ private function registrarDeteccionDelDia(string $fastId, array $vehiculo, ?int
|
|||||||
'modelo' => $vehiculo['modelo'] ?? null,
|
'modelo' => $vehiculo['modelo'] ?? null,
|
||||||
'color' => $vehiculo['color'] ?? null,
|
'color' => $vehiculo['color'] ?? null,
|
||||||
'arco_id' => $arcoId,
|
'arco_id' => $arcoId,
|
||||||
|
'arco_nombre' => $arcoNombre,
|
||||||
'antena' => $antena,
|
'antena' => $antena,
|
||||||
'estado' => $resultado['estado'] ?? 'LIBRE',
|
'estado' => $resultado['estado'] ?? 'LIBRE',
|
||||||
'tiene_reporte_robo' => $resultado['tiene_reporte_robo'] ?? false,
|
'tiene_reporte_robo' => $resultado['tiene_reporte_robo'] ?? false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user