fix: excel actualizaciones filtrar por modulo
This commit is contained in:
parent
e4419f1a50
commit
ebae87f97c
@ -45,10 +45,10 @@ public function vehicleActualizaciones(Request $request)
|
||||
$module = $moduleId ? Module::find($moduleId) : null;
|
||||
|
||||
// Consulta de Logs de actualizaciones
|
||||
$logs = VehicleTagLog::with(['vehicle', 'tag'])
|
||||
$logs = VehicleTagLog::with(['vehicle', 'tag', 'performedBy.module'])
|
||||
->where('action_type', 'actualizacion')
|
||||
->when($moduleId, function ($query) use ($moduleId) {
|
||||
$query->whereHas('vehicle.records', function ($q) use ($moduleId) {
|
||||
$query->whereHas('performedBy', function ($q) use ($moduleId) {
|
||||
$q->where('module_id', $moduleId);
|
||||
});
|
||||
})
|
||||
|
||||
@ -41,6 +41,10 @@ public function cancelledBy() {
|
||||
return $this->belongsTo(User::class, 'cancelled_by');
|
||||
}
|
||||
|
||||
public function performedBy() {
|
||||
return $this->belongsTo(User::class, 'performed_by');
|
||||
}
|
||||
|
||||
public function cancellationReason()
|
||||
{
|
||||
return $this->belongsTo(CatalogCancellationReason::class, 'cancellation_reason_id');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user