| @@ 613-625 (lines=13) @@ | ||
| 610 | GROUP BY gd.owner_name'.$order.$limit; |
|
| 611 | $result = $this->mysqli->query($req); |
|
| 612 | $trainers = array(); |
|
| 613 | while ($data = $result->fetch_object()) { |
|
| 614 | $data->last_seen = date('Y-m-d', strtotime($data->last_seen)); |
|
| 615 | if (is_null($data->active)) { |
|
| 616 | $data->active = 0; |
|
| 617 | } |
|
| 618 | $trainers[$data->name] = $data; |
|
| 619 | ||
| 620 | $pokemon = array_merge($this->getActivePokemon($data->name), $this->getInactivePokemon($data->name)); |
|
| 621 | ||
| 622 | $trainers[$data->name]->gyms = $data->active; |
|
| 623 | $trainers[$data->name]->pokemons = $pokemon; |
|
| 624 | $trainers[$data->name]->rank = $ranking[$data->level]; |
|
| 625 | } |
|
| 626 | ||
| 627 | return $trainers; |
|
| 628 | } |
|
| @@ 614-626 (lines=13) @@ | ||
| 611 | GROUP BY gd.owner_name'.$order.$limit; |
|
| 612 | $result = pg_query($this->db, $req); |
|
| 613 | $trainers = array(); |
|
| 614 | while ($data = pg_fetch_object($result)) { |
|
| 615 | $data->last_seen = date('Y-m-d', strtotime($data->last_seen)); |
|
| 616 | if (is_null($data->active)) { |
|
| 617 | $data->active = 0; |
|
| 618 | } |
|
| 619 | $trainers[$data->name] = $data; |
|
| 620 | ||
| 621 | $pokemon = array_merge($this->getActivePokemon($data->name), $this->getInactivePokemon($data->name)); |
|
| 622 | ||
| 623 | $trainers[$data->name]->gyms = $data->active; |
|
| 624 | $trainers[$data->name]->pokemons = $pokemon; |
|
| 625 | $trainers[$data->name]->rank = $ranking[$data->level]; |
|
| 626 | } |
|
| 627 | ||
| 628 | return $trainers; |
|
| 629 | } |
|