update
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Livewire;
|
||||
use App\Models\Cuentas;
|
||||
use App\Models\Historiale;
|
||||
use App\Models\Historial_cuenta;
|
||||
use App\Models\Log_general;
|
||||
use App\Models\Log_historial;
|
||||
use App\Models\Notificacion;
|
||||
use App\Models\Pendientes;
|
||||
@@ -193,12 +194,13 @@ class ShowPlanes extends Component
|
||||
}
|
||||
|
||||
//modal Ver
|
||||
public function ver($id, $nom)
|
||||
public function ver(Cuentas $cuenta)
|
||||
{
|
||||
$this->id_cuentaVer = $id;
|
||||
$this->consulta_verUsuarios = Cuentas::with('historiales', 'servicio')->where('id', $id)->first();
|
||||
//dd($this->consulta_verUsuarios);
|
||||
$this->nombre_servicios = $nom;
|
||||
$this->id_cuentaVer = $cuenta->id;
|
||||
$this->consulta_verUsuarios = $cuenta;
|
||||
$this->nombre_servicios = $this->consulta_verUsuarios->servicio->nombre;
|
||||
|
||||
$this->ver = true;
|
||||
}
|
||||
public function openRenovar()
|
||||
{
|
||||
@@ -683,6 +685,13 @@ class ShowPlanes extends Component
|
||||
'position' => 'top'
|
||||
]);
|
||||
}
|
||||
|
||||
$logsGeneral = new Log_general();
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha añadido el usuario ' . $this->searchTerm . ' a una cuenta ';
|
||||
// . ' a la cuenta ' . $this->consulta_verUsuarios->name . ' - ' . $this->consulta_verUsuarios->email;
|
||||
$logsGeneral->save();
|
||||
|
||||
$this->addUser = false;
|
||||
$this->consulta_verUsuarios = Cuentas::with('historiales', 'servicio')->where('id', $this->id_cuentaVer)->first();
|
||||
}
|
||||
|
||||
@@ -277,9 +277,9 @@ class ShowPromociones extends Component
|
||||
|
||||
$cuenta = Cuentas::where('servicio_id', $servicio_id)->whereDate('inicio', '>=', $this->fecha)->whereDate('vencimiento', '>=', $this->fecha_final_1)
|
||||
->whereDate('vencimiento', '<=', $this->fecha_final_2)
|
||||
->Orderby('created_at', 'ASC')->with('historiales')->withCount('historiales')->where('estado', 'pendiente')->having('historiales_count', '==', 0)->first();
|
||||
->Orderby('created_at', 'DESC')->with('historiales')->withCount('historiales')->where('estado', 'pendiente')->having('historiales_count', '==', 0)->first();
|
||||
} else {
|
||||
$cuenta = Cuentas::where('servicio_id', $servicio_id)->whereDate('inicio', '>=', $this->fecha)->Orderby('created_at', 'ASC')->with('historiales')->withCount('historiales')->where('estado', 'activo')->having('historiales_count', '<=', (int)$faltante)->first();
|
||||
$cuenta = Cuentas::where('servicio_id', $servicio_id)->whereDate('inicio', '>=', $this->fecha)->Orderby('created_at', 'DESC')->with('historiales')->withCount('historiales')->where('estado', 'activo')->having('historiales_count', '<=', (int)$faltante)->first();
|
||||
}
|
||||
|
||||
if (!is_null($cuenta)) {
|
||||
|
||||
Reference in New Issue
Block a user