From bee4b637b9f838ddc43cbffcfc5c2a78b278d748 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 3 Jan 2020 01:27:18 -0600 Subject: [PATCH] moon mailer modification needs testing --- app/Console/Commands/Moons/MoonMailer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/Moons/MoonMailer.php b/app/Console/Commands/Moons/MoonMailer.php index e5382cd3b..626d2a472 100644 --- a/app/Console/Commands/Moons/MoonMailer.php +++ b/app/Console/Commands/Moons/MoonMailer.php @@ -81,8 +81,8 @@ class MoonMailerCommand extends Command //For each of the contacts totalize the moon rental, and create the mail to send to them, //then update parameters of the moon foreach($contacts as $contact) { - //Get the moons the renter is renting - $rentals = MoonRental::where(['Contact' => $contact->Contact])->get(); + //Get the moons the renter is renting. Also only get the moons which are not paid as of today + $rentals = MoonRental::where(['Contact' => $contact->Contact])->andWhere($today, '>', 'Paid_Until')->get(); //Totalize the cost of the moons $cost = $this->TotalizeMoonCost($rentals);