From 10f74c4dc4032f39ff2646493b466e4d6cbdc810 Mon Sep 17 00:00:00 2001 From: "Anthony M. Powers" Date: Wed, 12 Jan 2022 00:25:12 -0800 Subject: [PATCH 1/6] feat: add corporate_reward_payout (#597) --- src/Traits/Stats.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Traits/Stats.php b/src/Traits/Stats.php index 381fdd76c..2dc5e2d66 100644 --- a/src/Traits/Stats.php +++ b/src/Traits/Stats.php @@ -71,7 +71,7 @@ public function getTotalCharacterMiningIsk(array $character_ids): ?float public function getTotalCharacterRattingIsk(array $character_ids): ?float { return CharacterWalletJournal::whereIn('second_party_id', $character_ids) - ->whereIn('ref_type', ['bounty_prizes', 'ess_escrow_transfer']) + ->whereIn('ref_type', ['bounty_prizes', 'ess_escrow_transfer', 'corporate_reward_payout']) ->whereYear('date', carbon()->year) ->whereMonth('date', carbon()->month) ->sum('amount'); @@ -125,9 +125,11 @@ public function getCharacterSkillCoverage(int $character_id): Collection $in_game_skills = DB::table('invTypes') ->join( 'invMarketGroups', - 'invMarketGroups.marketGroupID', '=', 'invTypes.marketGroupID' + 'invMarketGroups.marketGroupID', + '=', + 'invTypes.marketGroupID' ) - ->where('parentGroupID', '?')// binding at [1] + ->where('parentGroupID', '?') // binding at [1] ->select( 'marketGroupName', DB::raw('COUNT(*) * 5 as amount') @@ -137,15 +139,17 @@ public function getCharacterSkillCoverage(int $character_id): Collection $character_skills = CharacterSkill::join( 'invTypes', - 'invTypes.typeID', '=', + 'invTypes.typeID', + '=', 'character_skills.skill_id' ) ->join( 'invMarketGroups', - 'invMarketGroups.marketGroupID', '=', + 'invMarketGroups.marketGroupID', + '=', 'invTypes.marketGroupID' ) - ->where('character_id', '?')// binding at [2] + ->where('character_id', '?') // binding at [2] ->select( 'marketGroupName', DB::raw('COUNT(*) * character_skills.trained_skill_level as amount') @@ -167,8 +171,8 @@ public function getCharacterSkillCoverage(int $character_id): Collection DB::raw('SUM(b.amount) AS character_amount') ) ->groupBy(['a.marketGroupName', 'a.amount']) - ->addBinding(150, 'select')// binding [1] - ->addBinding($character_id, 'select')// binding [2] + ->addBinding(150, 'select') // binding [1] + ->addBinding($character_id, 'select') // binding [2] ->get(); return $skills; From 1df69df54b48575f1f4f4b0ef5c736ac3cdd7eba Mon Sep 17 00:00:00 2001 From: Crypta Electrica Date: Sun, 20 Feb 2022 11:53:53 +0000 Subject: [PATCH 2/6] fix: add check around impersonation button --- src/resources/views/includes/header.blade.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/resources/views/includes/header.blade.php b/src/resources/views/includes/header.blade.php index 762b8e01f..0d06b191b 100644 --- a/src/resources/views/includes/header.blade.php +++ b/src/resources/views/includes/header.blade.php @@ -25,11 +25,13 @@ @endcan + @if(session('impersonation_origin', false)) + @endif