| @@ 641-653 (lines=13) @@ | ||
| 638 | GROUP BY gd.owner_name'.$order.$limit; |
|
| 639 | $result = $this->mysqli->query($req); |
|
| 640 | $trainers = array(); |
|
| 641 | while ($data = $result->fetch_object()) { |
|
| 642 | $data->last_seen = date('Y-m-d', strtotime($data->last_seen)); |
|
| 643 | if (is_null($data->active)) { |
|
| 644 | $data->active = 0; |
|
| 645 | } |
|
| 646 | $trainers[$data->name] = $data; |
|
| 647 | ||
| 648 | $pokemon = array_merge($this->getActivePokemon($data->name), $this->getInactivePokemon($data->name)); |
|
| 649 | ||
| 650 | $trainers[$data->name]->gyms = $data->active; |
|
| 651 | $trainers[$data->name]->pokemons = $pokemon; |
|
| 652 | $trainers[$data->name]->rank = $ranking[$data->level]; |
|
| 653 | } |
|
| 654 | ||
| 655 | return $trainers; |
|
| 656 | } |
|
| @@ 642-654 (lines=13) @@ | ||
| 639 | GROUP BY gd.owner_name'.$order.$limit; |
|
| 640 | $result = pg_query($this->db, $req); |
|
| 641 | $trainers = array(); |
|
| 642 | while ($data = pg_fetch_object($result)) { |
|
| 643 | $data->last_seen = date('Y-m-d', strtotime($data->last_seen)); |
|
| 644 | if (is_null($data->active)) { |
|
| 645 | $data->active = 0; |
|
| 646 | } |
|
| 647 | $trainers[$data->name] = $data; |
|
| 648 | ||
| 649 | $pokemon = array_merge($this->getActivePokemon($data->name), $this->getInactivePokemon($data->name)); |
|
| 650 | ||
| 651 | $trainers[$data->name]->gyms = $data->active; |
|
| 652 | $trainers[$data->name]->pokemons = $pokemon; |
|
| 653 | $trainers[$data->name]->rank = $ranking[$data->level]; |
|
| 654 | } |
|
| 655 | ||
| 656 | return $trainers; |
|
| 657 | } |
|