diff --git a/app/Domains/Virtual/Repositories/Concerns/OrderCardConcern.php b/app/Domains/Virtual/Repositories/Concerns/OrderCardConcern.php index c49db91c..d90f979a 100644 --- a/app/Domains/Virtual/Repositories/Concerns/OrderCardConcern.php +++ b/app/Domains/Virtual/Repositories/Concerns/OrderCardConcern.php @@ -173,13 +173,13 @@ trait OrderCardConcern switch ($conditions['card_status']) { case 0: $this->model = $this->model->whereNull('service_start_at')->whereHas('card', function ($relation) { - $relation->whereNull('cancelled_at')->where('cancelled_at', "<", date('Y-m-d H:i:s')); + $relation->whereNull('cancelled_at')->orWhere('cancelled_at', "<", date('Y-m-d H:i:s')); })->where('created_at', '<', Carbon::now()->subMonths(6)); break; case 1: $this->model = $this->model->whereNull('service_start_at')->whereHas('card', function ($relation) { - $relation->whereNull('cancelled_at')->where('cancelled_at', "<", date('Y-m-d H:i:s')); + $relation->whereNull('cancelled_at')->orWhere('cancelled_at', "<", date('Y-m-d H:i:s')); })->where('created_at', '>=', Carbon::now()->subMonths(6)); break; @@ -189,7 +189,7 @@ trait OrderCardConcern $this->model = $this->model->whereNotNull('service_start_at') ->groupBy('sim')->havingRaw($havingRaw) ->whereHas('card', function ($relation) { - $relation->whereNull('cancelled_at')->where('cancelled_at', "<", date('Y-m-d H:i:s')); + $relation->whereNull('cancelled_at')->orWhere('cancelled_at', "<", date('Y-m-d H:i:s')); }); break; @@ -199,7 +199,7 @@ trait OrderCardConcern $this->model = $this->model->whereNotNull('service_start_at') ->groupBy('sim')->havingRaw($havingRaw) ->whereHas('card', function ($relation) { - $relation->whereNull('cancelled_at')->where('cancelled_at', "<", date('Y-m-d H:i:s')); + $relation->whereNull('cancelled_at')->orWhere('cancelled_at', "<", date('Y-m-d H:i:s')); }); break;