update
This commit is contained in:
@@ -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