havinraw
This commit is contained in:
@@ -183,16 +183,10 @@ class ShowServicios extends Component
|
||||
->whereDate('vencimiento', '<=', $this->fecha_final_2)
|
||||
->where('servicio_id', $servicio_tarifa->id)
|
||||
->where('estado', 'activo')
|
||||
//->with('perfil')
|
||||
//->whereDoesntHave('perfil', function ($query) use ($cantidad_restante) {
|
||||
// $query->select('cuenta_id')
|
||||
// ->groupBy('cuenta_id')
|
||||
// ->havingRaw("COUNT(*) >= $cantidad_restante");
|
||||
//})
|
||||
->withCount('historiales')
|
||||
->where('estado', 'activo')
|
||||
->having('historiales_count', '<=', $cantidad_restante)
|
||||
->havingRaw("(SELECT COUNT(*) FROM historiales WHERE historiales.cuenta_id = cuentas.id) <= ?", [$cantidad_restante])
|
||||
->get();
|
||||
|
||||
//dd($cuentas_pantallas); // con count da un numero entero
|
||||
|
||||
$cuentas_pantallas_tomadas = Historial_cuenta::whereIn('cuenta_id', $cuentas_pantallas
|
||||
@@ -474,12 +468,12 @@ class ShowServicios extends Component
|
||||
|
||||
DB::rollBack();
|
||||
$this->credenciales = false;
|
||||
$this->cuentas =[];
|
||||
$this->cuentas = [];
|
||||
|
||||
$this->alert('warning', 'Error al comprar: Esta cuenta ha sido tomada por otro usuario al mismo tiempo, intenta nuevamente' , [
|
||||
$this->alert('warning', 'Error al comprar: Esta cuenta ha sido tomada por otro usuario al mismo tiempo, intenta nuevamente', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user