From 7667031c952366003a84230fe287a59af7bf319d Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Thu, 25 Oct 2018 23:20:07 -0500 Subject: [PATCH] moon calc --- app/Library/MoonCalc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Library/MoonCalc.php b/app/Library/MoonCalc.php index 09bb8de79..4475e4f44 100644 --- a/app/Library/MoonCalc.php +++ b/app/Library/MoonCalc.php @@ -189,14 +189,13 @@ class MoonCalc { $thuliumPrice = DB::select('SELECT Price FROM Prices WHERE ItemId = ? AND Time = ?', [16653, $maxTime]); //Get the item compositions $items = DB::select('SELECT Name,ItemId FROM ItemComposition'); + dd($tritaniumPrice); //Go through each of the items and update the price foreach($items as $item) { //Get the item composition - //$composition = DB::select('SELECT * FROM ItemComposition WHERE ItemId = ?', [$item->ItemId]); - $composition = DB::table('Prices')->where('ItemId', $item->ItemId)->last(); - //$composition = DB::table('Prices')->where('ItemId', $item->ItemId); + $composition = DB::select('SELECT * FROM ItemComposition WHERE ItemId = ?', [$item->ItemId]); //Calculate the Batch Price - $batchPrice = ( ($composition['Tritanium'] * $tritaniumPrice) + + $batchPrice = ( ($composition->Tritanium * $tritaniumPrice) + ($composition['Pyerite'] * $pyeritePrice) + ($composition['Mexallon'] * $mexallonPrice) + ($composition['Isogen'] * $isogenPrice) +