update nullcheck a el log

This commit is contained in:
Felipe
2024-10-16 20:06:19 -05:00
parent 7454087a9c
commit 6a537837cf
+41 -31
View File
@@ -1,9 +1,9 @@
<div class=" text-center">
<input type="text" placeholder="Buscar" wire:model="buscar" class="mx-auto text-center rounded my-4">
<input type="text" placeholder="Buscar" wire:model="buscar" class="mx-auto text-center rounded my-4">
<table class="text-center w-full mx-8">
<tr class="border text-left">
<th>Id</th>
<th hidden>Id</th>
<th>Compra</th>
<th>Fecha Inicio</th>
<th>Fecha Final</th>
@@ -16,37 +16,47 @@
<th>Credenciales</th>
<th>Estado</th>
</tr>
@foreach($logs as $item)
<tr class="border hover:bg-gray-200 hover:ring-gray-500 text-left text-sm" >
<td>{{$item->id}}</td>
<td>{{\Carbon\Carbon::parse($item->created_at)->format('y/m/d h:i a')}}</td>
<td>{{\Carbon\Carbon::parse($item->fecha_inicio)->format('d/m/Y') }}</td>
<td>{{\Carbon\Carbon::parse($item->fecha_final)->format('d/m/Y') }}</td>
<td>{{$item->valor}}</td>
<td>{{$item->vendedor->name}}</td>
<td>{{$item->vendedor->email}}</td>
<td>{{$item->cliente->email}}</td>
<td>@if(!empty($item->promocion_id)) {{$item->promocion->nombre}} @elseif(!empty($item->tarifa_id)) @if(empty($item->tarifa->servicio->por_tiempo)) {{$item->tarifa->pantallas}} P. de @endif {{$item->tarifa->servicio->nombre}} - {{$item->tarifa->dias}} d. @endif </td>
<td>{{$item->nombre_cliente ?? $item->cliente->name}}</td>
<td class="text-left">
@if(!empty($item->cuentas_obsoletas->unique()))
@foreach($item->cuentas_obsoletas->unique() as $cuenta) {{$cuenta->correo}} - {{$cuenta->password}} <br> @endforeach
@endif
@if(!empty($item->cuentas->unique()))
@foreach($item->cuentas->unique() as $cuenta1) {{$cuenta1->correo}} - {{$cuenta1->password}} <br> @endforeach
@endif
</td>
<td>
{{$item->estado ?? ''}}
</td>
</tr>
@foreach ($logs as $item)
<tr class="border hover:bg-gray-200 hover:ring-gray-500 text-left text-sm">
<td hidden>{{ $item->id }}</td>
<td>{{ \Carbon\Carbon::parse($item->created_at ?? now())->format('y/m/d h:i a') }}</td>
<td>{{ \Carbon\Carbon::parse($item->fecha_inicio ?? now())->format('d/m/Y') }}</td>
<td>{{ \Carbon\Carbon::parse($item->fecha_final ?? now())->format('d/m/Y') }}</td>
<td>{{ $item->valor ?? '' }}</td>
<td>{{ $item->vendedor->name ?? 'Sin nombre' }}</td>
<td>{{ $item->vendedor->email ?? 'Sin correo' }}</td>
<td>{{ $item->cliente->email ?? 'Sin correo' }}</td>
<td>
@if (!empty($item->promocion_id))
{{ $item->promocion->nombre ?? 'Sin promoción' }}
@elseif(!empty($item->tarifa_id))
@if (empty($item->tarifa->servicio->por_tiempo))
{{ $item->tarifa->pantallas ?? 'N/A' }} P. de
@endif
{{ $item->tarifa->servicio->nombre ?? 'Sin nombre' }} - {{ $item->tarifa->dias ?? 'N/A' }} d.
@endif
</td>
<td>{{ $item->nombre_cliente ?? $item->cliente->name ?? 'Sin nombre' }}</td>
<td class="text-left">
@if (!empty($item->cuentas_obsoletas->unique()))
@foreach ($item->cuentas_obsoletas->unique() as $cuenta)
{{ $cuenta->correo ?? 'Sin correo' }} - {{ $cuenta->password ?? 'Sin contraseña' }} <br>
@endforeach
@endif
@if (!empty($item->cuentas->unique()))
@foreach ($item->cuentas->unique() as $cuenta1)
{{ $cuenta1->correo ?? 'Sin correo' }} - {{ $cuenta1->password ?? 'Sin contraseña' }} <br>
@endforeach
@endif
</td>
<td>
{{ $item->estado ?? 'Sin estado' }}
</td>
</tr>
@endforeach
</table>
<div class="mx-10">
{{ $logs->links( )}}
{{ $logs->links() }}
</div>
</div>