| @@ 199-209 (lines=11) @@ | ||
| 196 | return $toptrainer; |
|
| 197 | } |
|
| 198 | ||
| 199 | public function getPokemonHeatmap($pokemon_id, $start, $end) { |
|
| 200 | $where = " WHERE pokemon_id = ".$pokemon_id." " |
|
| 201 | . "AND FROM_UNIXTIME(expire_timestamp) BETWEEN '".$start."' AND '".$end."'"; |
|
| 202 | $req = "SELECT lat AS latitude, lon AS longitude FROM sightings".$where." ORDER BY expire_timestamp DESC LIMIT 100000"; |
|
| 203 | $result = $this->mysqli->query($req); |
|
| 204 | $points = array(); |
|
| 205 | while ($data = $result->fetch_object()) { |
|
| 206 | $points[] = $data; |
|
| 207 | } |
|
| 208 | return $points; |
|
| 209 | } |
|
| 210 | ||
| 211 | public function getPokemonGraph($pokemon_id) { |
|
| 212 | $req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour |
|
| @@ 200-210 (lines=11) @@ | ||
| 197 | return $toptrainer; |
|
| 198 | } |
|
| 199 | ||
| 200 | public function getPokemonHeatmap($pokemon_id, $start, $end) { |
|
| 201 | $where = " WHERE pokemon_id = ".$pokemon_id." " |
|
| 202 | . "AND disappear_time BETWEEN '".$start."' AND '".$end."'"; |
|
| 203 | $req = "SELECT latitude, longitude FROM pokemon".$where." ORDER BY disappear_time DESC LIMIT 10000"; |
|
| 204 | $result = $this->mysqli->query($req); |
|
| 205 | $points = array(); |
|
| 206 | while ($data = $result->fetch_object()) { |
|
| 207 | $points[] = $data; |
|
| 208 | } |
|
| 209 | return $points; |
|
| 210 | } |
|
| 211 | ||
| 212 | public function getPokemonGraph($pokemon_id) { |
|
| 213 | $req = "SELECT COUNT(*) AS total, |
|