This commit is contained in:
邓皓元 2019-11-19 17:21:38 +08:00
parent ff6241d13c
commit 7048a6af8d

View File

@ -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;