From 40f71c0a34171b34a8fa899ea02a6e779ac4a613 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sun, 12 Dec 2021 22:02:53 +0800 Subject: [PATCH] debug do email to vt --- app/Console/Commands/EmailDoToVTCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/EmailDoToVTCommand.php b/app/Console/Commands/EmailDoToVTCommand.php index 85c1ecc9..8087018e 100644 --- a/app/Console/Commands/EmailDoToVTCommand.php +++ b/app/Console/Commands/EmailDoToVTCommand.php @@ -66,13 +66,13 @@ class EmailDoToVTCommand extends Command $zip = new ZipArchive(); if ($zip->open($attachment, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) { - echo 'yes'; + $bookings = \App\Models\Booking::where('status', ApprovalStatus::COMPLETED)->whereDate('updated_at', Carbon::yesterday()) ->whereHas('transactions', function ($query){ return $query->where('type', TransactionType::BILL)->where('issuer', 2); })->get(); - if(!$bookings){ return; } + if(!count($bookings)){ return; } foreach ($bookings as $booking) { $file = $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();