Code Duplication    Length = 15-16 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 247-261 (lines=15) @@
244
        return $points;
245
    }
246
247
    public function getPokemonGraph($pokemon_id)
248
    {
249
        $req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour
250
					FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM sightings WHERE pokemon_id = '".$pokemon_id."' LIMIT 100000) AS pokemonFiltered
251
				GROUP BY disappear_hour
252
				ORDER BY disappear_hour";
253
        $result = $this->mysqli->query($req);
254
        $array = array_fill(0, 24, 0);
255
        while ($result && $data = $result->fetch_object()) {
256
            $array[$data->disappear_hour] = $data->total;
257
        }
258
        // shift array because AM/PM starts at 1AM not 0:00
259
        $array[] = $array[0];
260
        array_shift($array);
261
262
        return $array;
263
    }
264

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

@@ 249-264 (lines=16) @@
246
        return $points;
247
    }
248
249
    public function getPokemonGraph($pokemon_id)
250
    {
251
        $req = "SELECT COUNT(*) AS total,
252
				HOUR(CONVERT_TZ(disappear_time, '+00:00', '".self::$time_offset."')) AS disappear_hour
253
				FROM (SELECT disappear_time FROM pokemon WHERE pokemon_id = '".$pokemon_id."' LIMIT 100000) AS pokemonFiltered
254
				GROUP BY disappear_hour
255
				ORDER BY disappear_hour";
256
        $result = $this->mysqli->query($req);
257
        $array = array_fill(0, 24, 0);
258
        while ($result && $data = $result->fetch_object()) {
259
            $array[$data->disappear_hour] = $data->total;
260
        }
261
        // shift array because AM/PM starts at 1AM not 0:00
262
        $array[] = $array[0];
263
        array_shift($array);
264
265
        return $array;
266
    }
267