modified moons and adminmoons controllers

This commit is contained in:
2019-05-28 23:54:04 -05:00
parent 35555e3d7c
commit ca6829a3ba
4 changed files with 12 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ use Seat\Eseye\Eseye;
use App\Models\Jobs\JobProcessAssets; use App\Models\Jobs\JobProcessAssets;
class GetAssets extends Command class GetAssetsCommand extends Command
{ {
/** /**
* The name and signature of the console command. * The name and signature of the console command.

View File

@@ -19,7 +19,7 @@ use Seat\Eseye\Eseye;
//Models //Models
use App\Models\Jobs\JobProcessStructure; use App\Models\Jobs\JobProcessStructure;
class GetStructures extends Command class GetStructuresCommand extends Command
{ {
/** /**
* The name and signature of the console command. * The name and signature of the console command.

View File

@@ -87,6 +87,16 @@ class MoonsAdminController extends Controller
'Contact' => $contact, 'Contact' => $contact,
])->first(); ])->first();
//Calculate the price of the moon for when it's updated
$moon = Moon::where([
'System' => $request->system,
'Planet' => $request->planet,
'Moon' => $request->moon,
])->get()->toArray();
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
if($found && $request->removal != true) { if($found && $request->removal != true) {
if($allianceId = 99004116) { if($allianceId = 99004116) {
MoonRental::where([ MoonRental::where([
@@ -178,8 +188,6 @@ class MoonsAdminController extends Controller
//Setup calls to the MoonCalc class //Setup calls to the MoonCalc class
$moonCalc = new MoonCalc(); $moonCalc = new MoonCalc();
//Update the prices for the moon
$moonCalc->FetchNewPrices();
//Get all of the moons from the database //Get all of the moons from the database
$moons = Moon::orderBy('System', 'asc')->get(); $moons = Moon::orderBy('System', 'asc')->get();
//Declare the html variable and set it to null //Declare the html variable and set it to null

View File

@@ -37,8 +37,6 @@ class MoonsController extends Controller
$type = Auth::user()->user_type; $type = Auth::user()->user_type;
//Setup calls to the MoonCalc class //Setup calls to the MoonCalc class
$moonCalc = new MoonCalc(); $moonCalc = new MoonCalc();
//Update the prices for the moon
$moonCalc->FetchNewPrices();
//get all of the moons from the database //get all of the moons from the database
$moons = DB::table('Moons')->orderBy('System', 'asc')->get(); $moons = DB::table('Moons')->orderBy('System', 'asc')->get();
//Set the rental date as last month for moons not rented //Set the rental date as last month for moons not rented
@@ -126,8 +124,6 @@ class MoonsController extends Controller
//Setup calls to the MoonCalc class //Setup calls to the MoonCalc class
$moonCalc = new MoonCalc(); $moonCalc = new MoonCalc();
//Update the prices for the moon
$moonCalc->FetchNewPrices();
$totalGoo = $moonCalc->SpatialMoonsOnlyGooTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity, $totalGoo = $moonCalc->SpatialMoonsOnlyGooTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity,
$thirdOre, $thirdQuantity, $fourthOre, $fourthQuantity); $thirdOre, $thirdQuantity, $fourthOre, $fourthQuantity);