premios fixed

This commit is contained in:
Felipe
2024-03-07 10:55:42 -05:00
parent c36c6d44d9
commit cd68c1d966
5 changed files with 99 additions and 4 deletions
+13 -1
View File
@@ -3,6 +3,7 @@
namespace App\Http\Livewire;
use App\Models\Notificacion;
use App\Models\PremioEntregado;
use App\Models\Saldo;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
@@ -28,7 +29,7 @@ class Bell extends Component
$this->numNoti = count($consulta);
return view('livewire.bell', [
'consulta' => $consulta
'consulta' => $consulta,
]);
}
@@ -51,6 +52,17 @@ class Bell extends Component
$notificacion = Notificacion::find($id);
if (!$notificacion || $notificacion->estado == 0) {
$this->reclamandoPremio = false;
$this->alert('error', 'No se pudo reclamar el premio', [
'position' => 'top'
]);
return;
}
$consulta_saldo = Saldo::where('usuario_id', Auth::user()->id)->first();
if ($consulta_saldo) {