Code Duplication    Length = 21-21 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 210-230 (lines=21) @@
207
        return $top;
208
    }
209
210
    public function getTop50Trainers($pokemon_id, $best_order_by, $best_direction)
211
    {
212
        $trainer_blacklist = '';
213
        if (!empty(self::$config->system->trainer_blacklist)) {
214
            $trainer_blacklist = " AND owner_name NOT IN ('".implode("','", self::$config->system->trainer_blacklist)."')";
215
        }
216
217
        $req = "SELECT owner_name as trainer_name, ROUND((100*((atk_iv)+(def_iv)+(sta_iv))/45),1) AS IV, move_1, move_2, cp as cp,
218
                FROM_UNIXTIME(last_modified) AS lasttime, last_modified as last_seen
219
                FROM gym_defenders
220
				WHERE pokemon_id = '".$pokemon_id."'".$trainer_blacklist."
221
				ORDER BY $best_order_by $best_direction, owner_name ASC
222
				LIMIT 0,50";
223
224
        $result = $this->mysqli->query($req);
225
        $toptrainer = array();
226
        while ($data = $result->fetch_object()) {
227
            $toptrainer[] = $data;
228
        }
229
230
        return $toptrainer;
231
    }
232
233
    public function getPokemonHeatmap($pokemon_id, $start, $end)

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

@@ 211-231 (lines=21) @@
208
        return $top;
209
    }
210
211
    public function getTop50Trainers($pokemon_id, $best_order_by, $best_direction)
212
    {
213
        $trainer_blacklist = '';
214
        if (!empty(self::$config->system->trainer_blacklist)) {
215
            $trainer_blacklist = " AND trainer_name NOT IN ('".implode("','", self::$config->system->trainer_blacklist)."')";
216
        }
217
        $req = "SELECT trainer_name,
218
				ROUND((100*(iv_attack+iv_defense+iv_stamina)/45),1) AS IV,
219
				move_1, move_2, cp,
220
				DATE_FORMAT(last_seen, '%Y-%m-%d') AS lasttime, last_seen
221
				FROM gympokemon
222
				WHERE pokemon_id = '".$pokemon_id."'".$trainer_blacklist."
223
				ORDER BY $best_order_by $best_direction, trainer_name ASC
224
				LIMIT 0,50";
225
        $result = $this->mysqli->query($req);
226
        $toptrainer = array();
227
        while ($data = $result->fetch_object()) {
228
            $toptrainer[] = $data;
229
        }
230
231
        return $toptrainer;
232
    }
233
234
    public function getPokemonHeatmap($pokemon_id, $start, $end)