From 39f7fbbb991987f6c2370702c1965009c9c33b03 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Tue, 25 May 2021 01:52:05 +0900 Subject: [PATCH] testing new mining tax --- app/Http/Controllers/Test/TestController.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Test/TestController.php b/app/Http/Controllers/Test/TestController.php index 2a2f65b4c..9e89ca762 100644 --- a/app/Http/Controllers/Test/TestController.php +++ b/app/Http/Controllers/Test/TestController.php @@ -77,17 +77,21 @@ class TestController extends Controller $mailDelay = 15; $config = config('esi'); - //Get the users from the database - $mains = User::all(); + /** + * This section will determine if users are mains or alts of a main. + * If they are mains, we keep the key. If they are alts of a main, then we delete + * the key from the collection. + */ //Pluck all the users from the database of ledgers to determine if they are mains or alts. - $mains = Ledger::where([ + $tempMains = Ledger::where([ 'invoiced' => 'Yes', ])->where('last_updated', '>', Carbon::now()->subMonths(3))->pluck('character_id'); + + //Get the unique character ids from the ledgers in the previous statement + $tempMains = $tempMains->unique()->values()->all()->toArray(); - $mains = $mains->unique()->values()->all(); - - dd($mains); + dd($tempMains); /** * For each of the users, let's determine if there are any ledgers,