solo asignar cuentas por pantallas
This commit is contained in:
@@ -320,6 +320,7 @@ class ShowPlanes extends Component
|
|||||||
$servicio_id = $cuenta_renovar->servicio->id;
|
$servicio_id = $cuenta_renovar->servicio->id;
|
||||||
$servicioPantallas = Servicio::find($servicio_id)->pantallas;
|
$servicioPantallas = Servicio::find($servicio_id)->pantallas;
|
||||||
|
|
||||||
|
if($this->estado === 'activo'){
|
||||||
$cuentasPendientes = Pendientes::where('estado', 'pendiente')->where('servicio_id', $servicio_id)->take($servicioPantallas)->get();
|
$cuentasPendientes = Pendientes::where('estado', 'pendiente')->where('servicio_id', $servicio_id)->take($servicioPantallas)->get();
|
||||||
|
|
||||||
foreach ($cuentasPendientes as $i => $cuentaPendiente) {
|
foreach ($cuentasPendientes as $i => $cuentaPendiente) {
|
||||||
@@ -348,8 +349,7 @@ class ShowPlanes extends Component
|
|||||||
$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->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();
|
$logsGeneral->save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->alert('success', 'Cuenta renovada y liberada correctamente!', [
|
$this->alert('success', 'Cuenta renovada y liberada correctamente!', [
|
||||||
'position' => 'top'
|
'position' => 'top'
|
||||||
@@ -464,7 +464,7 @@ class ShowPlanes extends Component
|
|||||||
if ($this->estado === 'activo') {
|
if ($this->estado === 'activo') {
|
||||||
$servicioPantallas = Servicio::find($this->servicio_newCuenta)->pantallas;
|
$servicioPantallas = Servicio::find($this->servicio_newCuenta)->pantallas;
|
||||||
|
|
||||||
$cuentasPendientes = Pendientes::where('estado', 'pendiente')->where('servicio_id', $this->servicio_newCuenta)->take($servicioPantallas)->get();
|
$cuentasPendientes = ('estado', 'pendiente')->where('servicio_id', $this->servicio_newCuenta)->take($servicioPantallas)->get();
|
||||||
|
|
||||||
foreach ($cuentasPendientes as $i => $cuentaPendiente) {
|
foreach ($cuentasPendientes as $i => $cuentaPendiente) {
|
||||||
$servicioName = $cuentaPendiente->servicio->nombre;
|
$servicioName = $cuentaPendiente->servicio->nombre;
|
||||||
|
|||||||
Reference in New Issue
Block a user