| @@ 478-492 (lines=15) @@ | ||
| 475 | $result = $this->mysqli->query($req); |
|
| 476 | $history = array(); |
|
| 477 | $count = 0; |
|
| 478 | while ($data = $result->fetch_object()) { |
|
| 479 | $count++; |
|
| 480 | if ($data->total_cp == 0) { |
|
| 481 | $data->pokemon = array(); |
|
| 482 | $data->pokemon_count = 0; |
|
| 483 | $data->pokemon_uids = ""; |
|
| 484 | } else { |
|
| 485 | $data->pokemon = $this->getHistoryForGymPokemon($gym_id, $data->last_modified_real); |
|
| 486 | $data->pokemon_count = count($data->pokemon); |
|
| 487 | $data->pokemon_uids = implode(",", array_keys($data->pokemon)); |
|
| 488 | } |
|
| 489 | if ($data->total_cp === 0 || $data->pokemon_count !== 0) { |
|
| 490 | $history[] = $data; |
|
| 491 | } |
|
| 492 | } |
|
| 493 | if ($count !== ($pageSize + 1)) { |
|
| 494 | $last_page = true; |
|
| 495 | } else { |
|
| @@ 457-471 (lines=15) @@ | ||
| 454 | $result = pg_query($this->db, $req); |
|
| 455 | $history = array(); |
|
| 456 | $count = 0; |
|
| 457 | while ($data = pg_fetch_object($result)) { |
|
| 458 | $count++; |
|
| 459 | if ($data->total_cp == 0) { |
|
| 460 | $data->pokemon = array(); |
|
| 461 | $data->pokemon_count = 0; |
|
| 462 | $data->pokemon_uids = ""; |
|
| 463 | } else { |
|
| 464 | $data->pokemon = $this->getHistoryForGymPokemon($gym_id, $data->last_modified_real); |
|
| 465 | $data->pokemon_count = count($data->pokemon); |
|
| 466 | $data->pokemon_uids = implode(",", array_keys($data->pokemon)); |
|
| 467 | } |
|
| 468 | if ($data->total_cp === 0 || $data->pokemon_count !== 0) { |
|
| 469 | $history[] = $data; |
|
| 470 | } |
|
| 471 | } |
|
| 472 | if ($count !== ($pageSize + 1)) { |
|
| 473 | $last_page = true; |
|
| 474 | } else { |
|