This commit is contained in:
Felipe
2023-10-07 12:58:41 -05:00
parent 87124fdf46
commit 3d3a9cca5e
6 changed files with 242 additions and 271 deletions
+14 -4
View File
@@ -45,7 +45,7 @@ class ShowClientes extends Component
public $configuracion;
public $msj;
public $entradas = 10;
public function render()
{
@@ -53,7 +53,8 @@ class ShowClientes extends Component
$this->fechaActual = date('d/m/Y');
$fechaVencimiento = Carbon::now()->subDay(30);
$consulta_clientes = Historiale::where('vendedor_id', Auth()->user()->id)->whereDate('fecha_final', '>', $fechaVencimiento);
// $consulta_clientes = Historiale::where('vendedor_id', Auth()->user()->id)->whereDate('fecha_final', '>', $fechaVencimiento);
$consulta_clientes = Historiale::whereDate('fecha_final', '>', $fechaVencimiento);
$this->configuracion = User::where('id', Auth::user()->id)->whereDate('updated_at', '!=', $fechaHoy)->first();
@@ -82,7 +83,7 @@ class ShowClientes extends Component
$consulta_clientes = $consulta_clientes->with('tarifa', 'promocion', 'cliente')
->orderBy('id', 'DESC')
->paginate(15);
->paginate($this->entradas);
@@ -96,12 +97,21 @@ class ShowClientes extends Component
public function verCliente($id)
{
$this->consulta_historial = Historiale::with('promocion', 'tarifa', 'cliente', 'cuentas')->where('id', $id)->first();
// dd($this->consulta_historial );
$this->verCliente = true;
}
public function consultaPassword($id)
{
$historiale = Historiale::with('promocion', 'tarifa', 'cliente', 'cuentas')->where('id', $id)->first();
if ($historiale && $historiale->cuentas->isNotEmpty()) {
// Assuming 'password' is a property on the Cuentas model
return $historiale->cuentas->first()->password ?? '';
} else {
return '';
}
}
public function enviarNotificacion($id)
{