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