From 0bd41458cac244a4f8ab41532f356d042aad6e26 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Sat, 23 Feb 2019 14:44:44 -0600 Subject: [PATCH] update to login controller to fix issues updated moons controller to give total worth rather than renter. Left admin side as renter. --- app/Http/Controllers/Auth/LoginController.php | 4 ++-- app/Http/Controllers/MoonsAdminController.php | 8 +++---- app/Http/Controllers/MoonsController.php | 22 +++++++++---------- resources/views/moons/user/moon.blade.php | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 40443d56b..a4498d75d 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -276,8 +276,8 @@ class LoginController extends Controller 'corporation_id' => $character_info->corporation_id, ]); - $legacy = AllowedLogin::where(['login_type' => 'Legacy'])->get(['entity_id']); - $renter = AllowedLogin::where(['login_type' => 'Renter'])->get(['entity_id']); + $legacy = AllowedLogin::where(['login_type' => 'Legacy'])->pluck('entity_id')->toArray(); + $renter = AllowedLogin::where(['login_type' => 'Renter'])->pluck('entity_id')->toArray(); //Send back the appropriate group if(isset($corp_info->alliance_id)) { diff --git a/app/Http/Controllers/MoonsAdminController.php b/app/Http/Controllers/MoonsAdminController.php index e899bdcfc..13589eb15 100644 --- a/app/Http/Controllers/MoonsAdminController.php +++ b/app/Http/Controllers/MoonsAdminController.php @@ -33,11 +33,11 @@ class MoonsAdminController extends Controller $journal = DB::select('SELECT amount,reason,description,date FROM `player_donation_journal` WHERE corporation_id=98287666 AND date >= DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MONTH) ORDER BY date DESC'); - return view('moons.admin.moonjournal')->with('journal', $journal); + return view('moons/admin/moonjournal')->with('journal', $journal); } public function updateMoon() { - return view('moons.admin.updatemoon'); + return view('moons/admin/updatemoon'); } public function storeUpdateMoon(Request $request) { @@ -138,7 +138,7 @@ class MoonsAdminController extends Controller } public function addMoon() { - return view('moons.admin.addmoon'); + return view('moons/admin/addmoon'); } /** @@ -236,6 +236,6 @@ class MoonsAdminController extends Controller $html .= ''; } - return view('moons.admin.adminmoon')->with('html', $html); + return view('moons/admin/adminmoon')->with('html', $html); } } diff --git a/app/Http/Controllers/MoonsController.php b/app/Http/Controllers/MoonsController.php index 52622fec0..ac589c1ab 100644 --- a/app/Http/Controllers/MoonsController.php +++ b/app/Http/Controllers/MoonsController.php @@ -44,6 +44,10 @@ class MoonsController extends Controller $rentalEnd = $rentalEnd->format('m-d'); $price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity, $moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity); + + $worth = $moonCalc->SpatialMoonsTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity, + $thirdOre, $thirdQuantity, $fourthOre, $fourthQuantity); + //Add the data to the html string to be passed to the view $html .= ''; $html .= '' . $spm . ''; @@ -63,16 +67,16 @@ class MoonsController extends Controller } else { $html .= 'N/A'; } - $html .= '' . $moon->RentalCorp . ''; + $html .= '' . number_format($worth, "2", ".", ",") . ''; $html .= '' . $rentalEnd . ''; $html .= ''; } - return view('moons.user.moon')->with('html', $html); + return view('moons/user/moon')->with('html', $html); } public function displayTotalWorthForm() { - return view('moons.user.formTotalWorth'); + return view('moons/user/formTotalWorth'); } public function displayTotalWorth(Request $request) { @@ -90,16 +94,12 @@ class MoonsController extends Controller //Update the prices for the moon $moonCalc->FetchNewPrices(); - $totalGoo = $moonCalc->SpatialMoonsOnlyGooTotalWorth($firstOre, $firstQuantity, - $secondOre, $secondQuantity, - $thirdOre, $thirdQuantity, - $fourthOre, $fourthQuantity); + $totalGoo = $moonCalc->SpatialMoonsOnlyGooTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity, + $thirdOre, $thirdQuantity, $fourthOre, $fourthQuantity); $totalGoo = number_format($totalGoo, 2, ".", ","); - $totalWorth = $moonCalc->SpatialMoonsTotalWorth($firstOre, $firstQuantity, - $secondOre, $secondQuantity, - $thirdOre, $thirdQuantity, - $fourthOre, $fourthQuantity); + $totalWorth = $moonCalc->SpatialMoonsTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity, + $thirdOre, $thirdQuantity, $fourthOre, $fourthQuantity); $totalWorth = number_format($totalWorth, 2, ".", ","); return view('moons.user.displayTotalWorth')->with(['totalWorth' => $totalWorth, 'totalGoo' => $totalGoo]); diff --git a/resources/views/moons/user/moon.blade.php b/resources/views/moons/user/moon.blade.php index 751c71ea8..adcae53fa 100644 --- a/resources/views/moons/user/moon.blade.php +++ b/resources/views/moons/user/moon.blade.php @@ -14,7 +14,7 @@ Fourth Ore Quantity Rental Price - Renter + Moon Worth Rental End