update
This commit is contained in:
@@ -331,7 +331,7 @@ class ShowPlanes extends Component
|
|||||||
$historial_cuenta->save();
|
$historial_cuenta->save();
|
||||||
$cuentaPendiente->update(['estado' => 'cerrado']);
|
$cuentaPendiente->update(['estado' => 'cerrado']);
|
||||||
|
|
||||||
if ($cuentaPendiente->historial->vendedor !== null) {
|
if ($cuentaPendiente->historial?->vendedor !== null) {
|
||||||
$cuentaPendiente->historial->vendedor->notify(new NotificacionPendiente($servicioName));
|
$cuentaPendiente->historial->vendedor->notify(new NotificacionPendiente($servicioName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,23 +476,26 @@ class ShowPlanes extends Component
|
|||||||
$historial_cuenta->save();
|
$historial_cuenta->save();
|
||||||
$cuentaPendiente->update(['estado' => 'cerrado']);
|
$cuentaPendiente->update(['estado' => 'cerrado']);
|
||||||
|
|
||||||
if ($cuentaPendiente->historial->vendedor !== null) {
|
if ($cuentaPendiente->historial?->vendedor !== null) {
|
||||||
$cuentaPendiente->historial->vendedor->notify(new NotificacionPendiente($servicioName));
|
$cuentaPendiente->historial->vendedor->notify(new NotificacionPendiente($servicioName));
|
||||||
}
|
}
|
||||||
|
|
||||||
$consulta = new Notificacion();
|
$consulta = new Notificacion();
|
||||||
$consulta->remitente_id = Auth::user()->id;
|
$consulta->remitente_id = Auth::user()->id;
|
||||||
$consulta->destinatario_id = $historial_cuenta->historial->vendedor_id;
|
$consulta->destinatario_id = $historial_cuenta->historial?->vendedor_id ?? null;
|
||||||
$consulta->titulo = "Licencia asignada para $servicioName";
|
$consulta->titulo = "Licencia asignada para $servicioName";
|
||||||
$consulta->descripcion = 'La licencia de ' . $servicioName . ' ha sido activada y ahora puedes utilizar tu cuenta sin problemas. Tus credenciales son: correo: ' . $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password;
|
$consulta->descripcion = 'La licencia de ' . $servicioName . ' ha sido activada y ahora puedes utilizar tu cuenta sin problemas. Tus credenciales son: correo: ' . $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password;
|
||||||
$consulta->estado = true;
|
$consulta->estado = true;
|
||||||
$consulta->todos = false;
|
$consulta->todos = false;
|
||||||
$consulta->save();
|
$consulta->save();
|
||||||
|
|
||||||
$logsGeneral = new Log_general();
|
if ($cuentaPendiente->historial?->vendedor !== null) {
|
||||||
$logsGeneral->user_id = $historial_cuenta->historial->vendedor_id;
|
$logsGeneral = new Log_general();
|
||||||
$logsGeneral->detalle = 'Se asigno una cuenta ' . $servicioName . ', con credenciales: ' . $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password . ' Que se encontraba en estado pendiente';
|
$logsGeneral->user_id = $historial_cuenta->historial->vendedor_id;
|
||||||
$logsGeneral->save();
|
$logsGeneral->detalle = 'Se asigno una cuenta ' . $servicioName . ', con credenciales: ' . $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password . ' Que se encontraba en estado pendiente';
|
||||||
|
$logsGeneral->save();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user