ledger job

This commit is contained in:
2021-02-22 22:52:09 +09:00
parent 8e72c71071
commit 41b64ac646

View File

@@ -212,7 +212,8 @@ class MoonCalc {
public function CalculateOrePrice($oreId) { public function CalculateOrePrice($oreId) {
//Declare variables //Declare variables
$lookupHelper = new LookupHelper; $lookupHelper = new LookupHelper;
$finalName = ''; $finalName = null;
$oreId = null;
$pastTime = Carbon::now()->subDays(30); $pastTime = Carbon::now()->subDays(30);
@@ -243,7 +244,7 @@ class MoonCalc {
//Strip the prefix from the ore name if it has one. //Strip the prefix from the ore name if it has one.
//Then change the ore id if necessary //Then change the ore id if necessary
$tempName = str_split($oreName); $tempName = explode(' ', $oreName);
if(sizeof($tempName) == 1) { if(sizeof($tempName) == 1) {
$finalName = $tempName[0]; $finalName = $tempName[0];
} else { } else {
@@ -254,6 +255,8 @@ class MoonCalc {
//Get the item composition for the ore //Get the item composition for the ore
$composition = ItemComposition::where('ItemId', $oreId)->first(); $composition = ItemComposition::where('ItemId', $oreId)->first();
dd($composition);
//Calculate the Batch Price //Calculate the Batch Price
$batchPrice = ( ($composition->Tritanium * $tritaniumPrice) + $batchPrice = ( ($composition->Tritanium * $tritaniumPrice) +
($composition->Pyerite * $pyeritePrice) + ($composition->Pyerite * $pyeritePrice) +