flex structure form
This commit is contained in:
@@ -69,7 +69,7 @@ class MoonMailerCommand extends Command
|
||||
|
||||
//Get today's date.
|
||||
$today = Carbon::now();
|
||||
$today->second = 2;
|
||||
$today->second = 1;
|
||||
$today->minute = 0;
|
||||
$today->hour = 0;
|
||||
|
||||
@@ -168,6 +168,12 @@ class MoonMailerCommand extends Command
|
||||
$totalCost = 0.00;
|
||||
$price = null;
|
||||
|
||||
//Create the date for today
|
||||
$today = Carbon::now();
|
||||
$today->second = 1;
|
||||
$today->minute = 0;
|
||||
$today->hour = 0;
|
||||
|
||||
foreach($rentals as $rental) {
|
||||
$moon = Moon::where([
|
||||
'System' => $rental->System,
|
||||
@@ -175,6 +181,11 @@ class MoonMailerCommand extends Command
|
||||
'Moon' => $rental->Moon,
|
||||
])->first();
|
||||
|
||||
//Create the date time object for the rental end
|
||||
$end = new Carbon($rental->Paid_Until);
|
||||
|
||||
//If today is greater than the rental end, then calculate the moon cost
|
||||
if($today->greaterThanOrEqualTo($end)) {
|
||||
//Get the updated price for the moon
|
||||
$price = $moonCalc->SpatialMoonsOnlyGooMailer($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||
@@ -186,6 +197,7 @@ class MoonMailerCommand extends Command
|
||||
$totalCost += $price['outofalliance'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Return the total cost back to the calling function
|
||||
return $totalCost;
|
||||
|
||||
Reference in New Issue
Block a user