From ddcd082feef82efa4ea55f71e7ae1864b6cb88b0 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Sun, 1 Dec 2019 04:13:42 -0600 Subject: [PATCH] message --- .../Controllers/Blacklist/BlacklistController.php | 4 ++-- app/Library/Lookups/NewLookupHelper.php | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Blacklist/BlacklistController.php b/app/Http/Controllers/Blacklist/BlacklistController.php index 116aa6e5d..dd54b00f3 100644 --- a/app/Http/Controllers/Blacklist/BlacklistController.php +++ b/app/Http/Controllers/Blacklist/BlacklistController.php @@ -58,7 +58,7 @@ class BlacklistController extends Controller //Get the character id from the universe end point $charId = $lookup->CharacterNameToId($request->name); - if($charId != -1) { + if($charId != null) { //Insert the character into the blacklist table BlacklistUser::insert([ 'character_id' => $charId, @@ -70,7 +70,7 @@ class BlacklistController extends Controller ]); } else { //Redirect back to the view - return redirect('/blacklist/display/add')->with('error', $request->name . ' has been biomassed.'); + return redirect('/blacklist/display/add')->with('error', $request->name . ' could not be added.'); } } else { //Return the view diff --git a/app/Library/Lookups/NewLookupHelper.php b/app/Library/Lookups/NewLookupHelper.php index c92b826fe..29470dbe3 100644 --- a/app/Library/Lookups/NewLookupHelper.php +++ b/app/Library/Lookups/NewLookupHelper.php @@ -92,7 +92,7 @@ class NewLookupHelper { return $response->characters[0]->id; } else { - return -1; + return null; } } } @@ -147,7 +147,7 @@ class NewLookupHelper { return $response->corporations[0]->id; } else { - return -1; + return null; } } } @@ -200,7 +200,7 @@ class NewLookupHelper { return $response->alliances[0]->id; } else { - return -1; + return null; } } } @@ -359,7 +359,10 @@ class NewLookupHelper { } private function SaveCharacter($response, $charId) { + $esiHelper = new Esi; + $char = new CharacterLookup; + $char->character_id = $charId; if(isset($response->alliance_id)) { $char->alliance_id = $response->alliance_id; @@ -367,7 +370,7 @@ class NewLookupHelper { if(isset($response->ancestry_id)) { $char->ancestry_id = $response->ancestry_id; } - $char->birthday = $response->birthday; + $char->birthday = $esiHelper->DecodeDate($response->birthday); $char->bloodline_id = $response->bloodline_id; $char->corporation_id = $response->corporation_id; if(isset($response->description)) {