update
This commit is contained in:
@@ -9,7 +9,7 @@ LOG_DEPRECATIONS_CHANNEL=null
|
|||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=localhost
|
DB_HOST=195.35.32.59
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_DATABASE=sirpremium
|
DB_DATABASE=sirpremium
|
||||||
DB_USERNAME=pym
|
DB_USERNAME=pym
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class ShowServicios extends Component
|
|||||||
$cantidad_solicitada = (int) $this->cantidad_tarjetaPlan * (int) $this->pantallas_tarjetaPlan;
|
$cantidad_solicitada = (int) $this->cantidad_tarjetaPlan * (int) $this->pantallas_tarjetaPlan;
|
||||||
$cantidad_restante = $servicio_tarifa->pantallas - $cantidad_solicitada;
|
$cantidad_restante = $servicio_tarifa->pantallas - $cantidad_solicitada;
|
||||||
|
|
||||||
//Traer todas las cuentas completas 'pendiente' de los ultimos 15 dias. solo disponibles
|
//Traer todas las cuentas por pantalla 'activo' de los ultimos 15 dias. solo disponibles
|
||||||
$cuentas_pantallas = Cuentas::whereDate('inicio', '>=', $this->fecha)
|
$cuentas_pantallas = Cuentas::whereDate('inicio', '>=', $this->fecha)
|
||||||
->whereDate('vencimiento', '>=', $this->fecha_final_1)
|
->whereDate('vencimiento', '>=', $this->fecha_final_1)
|
||||||
->whereDate('vencimiento', '<=', $this->fecha_final_2)
|
->whereDate('vencimiento', '<=', $this->fecha_final_2)
|
||||||
@@ -184,6 +184,7 @@ class ShowServicios extends Component
|
|||||||
->havingRaw("COUNT(*) >= $cantidad_restante");
|
->havingRaw("COUNT(*) >= $cantidad_restante");
|
||||||
})
|
})
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
//dd($cuentas_pantallas);
|
//dd($cuentas_pantallas);
|
||||||
$cuentas_pantallas_tomadas = Historial_cuenta::whereIn('cuenta_id', $cuentas_pantallas
|
$cuentas_pantallas_tomadas = Historial_cuenta::whereIn('cuenta_id', $cuentas_pantallas
|
||||||
->pluck('id'))
|
->pluck('id'))
|
||||||
@@ -290,15 +291,15 @@ class ShowServicios extends Component
|
|||||||
->whereDate('vencimiento', '<=', $this->fecha_final_2)
|
->whereDate('vencimiento', '<=', $this->fecha_final_2)
|
||||||
// ->whereDate('vencimiento','>=', $this->fechaFinal)
|
// ->whereDate('vencimiento','>=', $this->fechaFinal)
|
||||||
->Orderby('created_at', 'ASC')
|
->Orderby('created_at', 'ASC')
|
||||||
//->withCount('historiales')
|
->withCount('historiales')
|
||||||
->where('estado', 'activo')
|
->where('estado', 'activo')
|
||||||
//->having('historiales_count', '<=', $suma)
|
->having('historiales_count', '<=', $suma)
|
||||||
->with('perfil')
|
//->with('perfil')
|
||||||
->whereDoesntHave('perfil', function ($query) use ($suma) {
|
//->whereDoesntHave('perfil', function ($query) use ($suma) {
|
||||||
$query->select('cuenta_id')
|
// $query->select('cuenta_id')
|
||||||
->groupBy('cuenta_id')
|
// ->groupBy('cuenta_id')
|
||||||
->havingRaw("COUNT(*) >= $suma");
|
// ->havingRaw("COUNT(*) >= $suma");
|
||||||
})
|
//})
|
||||||
->get();
|
->get();
|
||||||
// dd($cuenta);
|
// dd($cuenta);
|
||||||
} elseif ((int) $pantalla_servicio_completa == (int) $this->pantallas_tarjetaPlan) {
|
} elseif ((int) $pantalla_servicio_completa == (int) $this->pantallas_tarjetaPlan) {
|
||||||
@@ -319,15 +320,15 @@ class ShowServicios extends Component
|
|||||||
$cuenta = Cuentas::where('servicio_id', $this->servicio_id)
|
$cuenta = Cuentas::where('servicio_id', $this->servicio_id)
|
||||||
->whereDate('inicio', '>=', $this->fecha)
|
->whereDate('inicio', '>=', $this->fecha)
|
||||||
->Orderby('created_at', 'ASC')
|
->Orderby('created_at', 'ASC')
|
||||||
//->withCount('historiales')
|
->withCount('historiales')
|
||||||
->where('estado', 'activo')
|
->where('estado', 'activo')
|
||||||
//->having('historiales_count', '<=', $suma2)
|
->having('historiales_count', '<=', $suma2)
|
||||||
->with('perfil')
|
//->with('perfil')
|
||||||
->whereDoesntHave('perfil', function ($query) use ($suma2) {
|
//->whereDoesntHave('perfil', function ($query) use ($suma2) {
|
||||||
$query->select('cuenta_id')
|
//$query->select('cuenta_id')
|
||||||
->groupBy('cuenta_id')
|
// ->groupBy('cuenta_id')
|
||||||
->havingRaw("COUNT(*) >= $suma2");
|
// ->havingRaw("COUNT(*) >= $suma2");
|
||||||
})
|
//})
|
||||||
->get();
|
->get();
|
||||||
} else {
|
} else {
|
||||||
$cuenta = null;
|
$cuenta = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user