From 7f04d511c452378d4276b035c7569a4b71f0449d Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:39:00 -0400 Subject: [PATCH] Removes scalar on builds --- .../Global/GlobalTalentStatsController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Http/Controllers/Global/GlobalTalentStatsController.php b/app/Http/Controllers/Global/GlobalTalentStatsController.php index 57c1b932..e65ff806 100644 --- a/app/Http/Controllers/Global/GlobalTalentStatsController.php +++ b/app/Http/Controllers/Global/GlobalTalentStatsController.php @@ -234,6 +234,7 @@ public function getGlobalHeroTalentBuildData(Request $request) $talentbuildType = $request['talentbuildtype']; $cacheKey = 'GlobalHeroTalentStatsBuilds|'.implode(',', \App\Models\SeasonGameVersion::select('id')->whereIn('game_version', $gameVersion)->pluck('id')->toArray()).'|'.hash('sha256', json_encode($request->all())); + //return $cacheKey; $data = Cache::remember($cacheKey, $this->globalDataService->calculateCacheTimeInMinutes($gameVersion), function () use ( @@ -474,8 +475,12 @@ private function getTopBuildsData($build, $win_loss, $hero, $gameVersion, $gameT ->get(); $transformedData = [ + /* 'wins' => ($transformedData['wins'] + ($data->where('win_loss', 1)->sum('games_played') * 1.125)), 'losses' => ($transformedData['losses'] + ($data->where('win_loss', 0)->sum('games_played') * 1.125)), + */ + 'wins' => ($transformedData['wins'] + ($data->where('win_loss', 1)->sum('games_played'))), + 'losses' => ($transformedData['losses'] + ($data->where('win_loss', 0)->sum('games_played'))), 'total_filter_type' => $statFilter !== 'win_rate' ? ($transformedData['total_filter_type'] + $data->sum('total_filter_type')) : 0, ]; @@ -507,8 +512,12 @@ private function getTopBuildsData($build, $win_loss, $hero, $gameVersion, $gameT ->get(); $transformedData = [ + /* 'wins' => ($transformedData['wins'] + ($data->where('win_loss', 1)->sum('games_played') * 1.33)), 'losses' => ($transformedData['losses'] + ($data->where('win_loss', 0)->sum('games_played') * 1.33)), + */ + 'wins' => ($transformedData['wins'] + ($data->where('win_loss', 1)->sum('games_played'))), + 'losses' => ($transformedData['losses'] + ($data->where('win_loss', 0)->sum('games_played'))), 'total_filter_type' => $statFilter !== 'win_rate' ? ($transformedData['total_filter_type'] + $data->sum('total_filter_type')) : 0, ]; @@ -540,8 +549,12 @@ private function getTopBuildsData($build, $win_loss, $hero, $gameVersion, $gameT ->get(); $transformedData = [ + /* 'wins' => round($transformedData['wins'] + ($data->where('win_loss', 1)->sum('games_played') * 1.5)), 'losses' => round($transformedData['losses'] + ($data->where('win_loss', 0)->sum('games_played') * 1.5)), + */ + 'wins' => round($transformedData['wins'] + ($data->where('win_loss', 1)->sum('games_played'))), + 'losses' => round($transformedData['losses'] + ($data->where('win_loss', 0)->sum('games_played'))), 'total_filter_type' => $statFilter !== 'win_rate' ? ($transformedData['total_filter_type'] + $data->sum('total_filter_type')) : 0, ];