update nullcheck a el log

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