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