| @@ 530-544 (lines=15) @@ | ||
| 527 | $result = $this->mysqli->query($req); |
|
| 528 | $history = array(); |
|
| 529 | $count = 0; |
|
| 530 | while ($data = $result->fetch_object()) { |
|
| 531 | ++$count; |
|
| 532 | if (0 == $data->total_cp) { |
|
| 533 | $data->pokemon = array(); |
|
| 534 | $data->pokemon_count = 0; |
|
| 535 | $data->pokemon_uids = ''; |
|
| 536 | } else { |
|
| 537 | $data->pokemon = $this->getHistoryForGymPokemon($gym_id, $data->last_modified_real); |
|
| 538 | $data->pokemon_count = count($data->pokemon); |
|
| 539 | $data->pokemon_uids = implode(',', array_keys($data->pokemon)); |
|
| 540 | } |
|
| 541 | if (0 === $data->total_cp || 0 !== $data->pokemon_count) { |
|
| 542 | $history[] = $data; |
|
| 543 | } |
|
| 544 | } |
|
| 545 | if ($count !== ($pageSize + 1)) { |
|
| 546 | $last_page = true; |
|
| 547 | } else { |
|
| @@ 509-523 (lines=15) @@ | ||
| 506 | $result = pg_query($this->db, $req); |
|
| 507 | $history = array(); |
|
| 508 | $count = 0; |
|
| 509 | while ($data = pg_fetch_object($result)) { |
|
| 510 | ++$count; |
|
| 511 | if (0 == $data->total_cp) { |
|
| 512 | $data->pokemon = array(); |
|
| 513 | $data->pokemon_count = 0; |
|
| 514 | $data->pokemon_uids = ''; |
|
| 515 | } else { |
|
| 516 | $data->pokemon = $this->getHistoryForGymPokemon($gym_id, $data->last_modified_real); |
|
| 517 | $data->pokemon_count = count($data->pokemon); |
|
| 518 | $data->pokemon_uids = implode(',', array_keys($data->pokemon)); |
|
| 519 | } |
|
| 520 | if (0 === $data->total_cp || 0 !== $data->pokemon_count) { |
|
| 521 | $history[] = $data; |
|
| 522 | } |
|
| 523 | } |
|
| 524 | if ($count !== ($pageSize + 1)) { |
|
| 525 | $last_page = true; |
|
| 526 | } else { |
|