adding compositions to display total worth page
This commit is contained in:
@@ -133,6 +133,16 @@ class MoonsController extends Controller
|
||||
$thirdOre, $thirdQuantity, $fourthOre, $fourthQuantity);
|
||||
$totalWorth = number_format($totalWorth, 2, ".", ",");
|
||||
|
||||
return view('moons.user.displayTotalWorth')->with(['totalWorth' => $totalWorth, 'totalGoo' => $totalGoo]);
|
||||
$firstComp = $moonCalc->GetOreComposition($firstOre);
|
||||
$secondComp = $moonCalc->GetOreComposition($secondOre);
|
||||
$thirdComp = $moonCalc->GetOreComposition($thirdOre);
|
||||
$fourthComp = $moonCalc->GetOreComposition($fourthOre);
|
||||
|
||||
$composition['Tritanium'] = $firstComp['Tritanium'] + $secondComp['Tritanium'] + $thirdComp['Tritanium'] + $fourthComp['Tritanium'];
|
||||
|
||||
|
||||
return view('moons.user.displayTotalWorth')->with('totalWorth', $totalWorth)
|
||||
->with('totalGoo', $totalGoo)
|
||||
->with('composition', $composition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,14 @@ use App\Models\Moon\Price;
|
||||
|
||||
class MoonCalc {
|
||||
|
||||
public function GetOreComposition($ore) {
|
||||
$composition = ItemComposition::where([
|
||||
'Name' => $ore,
|
||||
])->first()->toArray();
|
||||
|
||||
return $composition;
|
||||
}
|
||||
|
||||
public function SpatialMoonsTotalWorth($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan) {
|
||||
//Always assume a 1 month pull which equates to 5.55m3 per second or 2,592,000 seconds
|
||||
//Total pull size is 14,385,600 m3
|
||||
|
||||
Reference in New Issue
Block a user