From 41b64ac64608e4dd61b2013bbc12df944776852c Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Mon, 22 Feb 2021 22:52:09 +0900 Subject: [PATCH] ledger job --- app/Library/Moons/MoonCalc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Library/Moons/MoonCalc.php b/app/Library/Moons/MoonCalc.php index d5b28a78c..51f74fa32 100644 --- a/app/Library/Moons/MoonCalc.php +++ b/app/Library/Moons/MoonCalc.php @@ -212,7 +212,8 @@ class MoonCalc { public function CalculateOrePrice($oreId) { //Declare variables $lookupHelper = new LookupHelper; - $finalName = ''; + $finalName = null; + $oreId = null; $pastTime = Carbon::now()->subDays(30); @@ -243,7 +244,7 @@ class MoonCalc { //Strip the prefix from the ore name if it has one. //Then change the ore id if necessary - $tempName = str_split($oreName); + $tempName = explode(' ', $oreName); if(sizeof($tempName) == 1) { $finalName = $tempName[0]; } else { @@ -254,6 +255,8 @@ class MoonCalc { //Get the item composition for the ore $composition = ItemComposition::where('ItemId', $oreId)->first(); + dd($composition); + //Calculate the Batch Price $batchPrice = ( ($composition->Tritanium * $tritaniumPrice) + ($composition->Pyerite * $pyeritePrice) +