| @@ 211-225 (lines=15) @@ | ||
| 208 | return $points; |
|
| 209 | } |
|
| 210 | ||
| 211 | public function getPokemonGraph($pokemon_id) { |
|
| 212 | $req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour |
|
| 213 | FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM sightings WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time LIMIT 100000) AS pokemonFiltered |
|
| 214 | GROUP BY disappear_hour |
|
| 215 | ORDER BY disappear_hour"; |
|
| 216 | $result = $this->mysqli->query($req); |
|
| 217 | $array = array_fill(0, 24, 0); |
|
| 218 | while ($result && $data = $result->fetch_object()) { |
|
| 219 | $array[$data->disappear_hour] = $data->total; |
|
| 220 | } |
|
| 221 | // shift array because AM/PM starts at 1AM not 0:00 |
|
| 222 | $array[] = $array[0]; |
|
| 223 | array_shift($array); |
|
| 224 | return $array; |
|
| 225 | } |
|
| 226 | ||
| 227 | public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons) { |
|
| 228 | $inmap_pkms_filter = ""; |
|
| @@ 212-227 (lines=16) @@ | ||
| 209 | return $points; |
|
| 210 | } |
|
| 211 | ||
| 212 | public function getPokemonGraph($pokemon_id) { |
|
| 213 | $req = "SELECT COUNT(*) AS total, |
|
| 214 | HOUR(CONVERT_TZ(disappear_time, '+00:00', '".self::$time_offset."')) AS disappear_hour |
|
| 215 | FROM (SELECT disappear_time FROM pokemon WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time LIMIT 100000) AS pokemonFiltered |
|
| 216 | GROUP BY disappear_hour |
|
| 217 | ORDER BY disappear_hour"; |
|
| 218 | $result = $this->mysqli->query($req); |
|
| 219 | $array = array_fill(0, 24, 0); |
|
| 220 | while ($result && $data = $result->fetch_object()) { |
|
| 221 | $array[$data->disappear_hour] = $data->total; |
|
| 222 | } |
|
| 223 | // shift array because AM/PM starts at 1AM not 0:00 |
|
| 224 | $array[] = $array[0]; |
|
| 225 | array_shift($array); |
|
| 226 | return $array; |
|
| 227 | } |
|
| 228 | ||
| 229 | public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons) { |
|
| 230 | $inmap_pkms_filter = ""; |
|