item composition model

This commit is contained in:
2018-10-25 23:05:29 -05:00
parent 7ebe0d7601
commit 92bd35e2da
6 changed files with 89 additions and 3 deletions
+2 -2
View File
@@ -15,6 +15,7 @@ use GuzzleHttp\Client;
use App\Config;
use App\Moon;
use App\Price;
use App\ItemComposition;
class MoonCalc {
@@ -193,9 +194,8 @@ class MoonCalc {
foreach($items as $item) {
//Get the item composition
$composition = DB::select('SELECT * FROM ItemComposition WHERE ItemId = ?', [$item->ItemId]);
dd($composition);
//Calculate the Batch Price
$batchPrice = ( ($composition['Tritanium'] * $tritaniumPrice) +
$batchPrice = ( ($composition->Tritanium * $tritaniumPrice) +
($composition['Pyerite'] * $pyeritePrice) +
($composition['Mexallon'] * $mexallonPrice) +
($composition['Isogen'] * $isogenPrice) +