modified a few moons controller variables to not create the variable each time the loop is run to save on a bit of processing time.
This commit is contained in:
@@ -41,6 +41,11 @@ class MoonsController extends Controller
|
||||
$moonCalc->FetchNewPrices();
|
||||
//get all of the moons from the database
|
||||
$moons = DB::table('Moons')->orderBy('System', 'asc')->get();
|
||||
//Set the rental date as last month for moons not rented
|
||||
$lastMonth = Carbon::now()->subMonth();
|
||||
//Set a variable for today's date
|
||||
$today = Carbon::now();
|
||||
|
||||
//declare the html variable and set it to null
|
||||
|
||||
$table = array();
|
||||
@@ -55,7 +60,7 @@ class MoonsController extends Controller
|
||||
|
||||
if($rental == false) {
|
||||
//If we don't find a rental record, set the rental date as last month
|
||||
$rentalTemp = Carbon::now()->subMonth();
|
||||
$rentalTemp = $lastMonth;
|
||||
$rentalEnd = $rentalTemp->format('m-d');
|
||||
} else {
|
||||
//Set the rental date up
|
||||
@@ -63,9 +68,6 @@ class MoonsController extends Controller
|
||||
$rentalEnd = $rentalTemp->format('m-d');
|
||||
}
|
||||
|
||||
//mark today's date in carbon format
|
||||
$today = Carbon::now();
|
||||
|
||||
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user