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