From c40138c19aa6946189c2cc2d965b5f23f4d06402 Mon Sep 17 00:00:00 2001 From: denghy Date: Fri, 10 May 2019 16:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Domains/Virtual/Services/CardService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Domains/Virtual/Services/CardService.php b/app/Domains/Virtual/Services/CardService.php index 09ec21e0..2bbf18ab 100644 --- a/app/Domains/Virtual/Services/CardService.php +++ b/app/Domains/Virtual/Services/CardService.php @@ -62,19 +62,19 @@ class CardService extends Service { switch ($card_status) { case 0: - $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereNull('service_start_at')->whereHas('card', function ($relation) { + $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereIn('type', [0, 1, 2])->whereNull('service_start_at')->whereHas('card', function ($relation) { $relation->whereNull('cancelled_at'); })->where('created_at', '<', Carbon::now()->subMonths(6))->orderBy('created_at', 'desc')->paginate($limit); break; case 1: - $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereNull('service_start_at')->whereHas('card', function ($relation) { + $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereIn('type', [0, 1, 2])->whereNull('service_start_at')->whereHas('card', function ($relation) { $relation->whereNull('cancelled_at'); })->where('created_at', '>=', Carbon::now()->subMonths(6))->orderBy('created_at', 'desc')->paginate($limit); break; case 2: - $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereNotNull('service_start_at') + $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereIn('type', [0, 1, 2])->whereNotNull('service_start_at') ->where('service_start_at', '<=', date('Y-m-d H:i:s')) ->where('service_end_at', '>=', date('Y-m-d H:i:s')) ->whereHas('card', function ($relation) { @@ -83,7 +83,7 @@ class CardService extends Service break; case 3: - $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereNotNull('service_start_at') + $res = OrderCardPartition::selectRaw('DISTINCT(sim) sim, created_at')->whereIn('type', [0, 1, 2])->whereNotNull('service_start_at') ->where('service_start_at', '<=', date('Y-m-d H:i:s')) ->where('service_end_at', '>=', date('Y-m-d H:i:s')) ->whereHas('card', function ($relation) {