| @@ 470-489 (lines=20) @@ | ||
| 467 | return $data; |
|
| 468 | } |
|
| 469 | ||
| 470 | public function getNestData() { |
|
| 471 | $pokemon_exclude_sql = ""; |
|
| 472 | if (!empty(self::$config->system->nest_exclude_pokemon)) { |
|
| 473 | $pokemon_exclude_sql = "AND p.pokemon_id NOT IN (" . implode(",", self::$config->system->nest_exclude_pokemon) . ")"; |
|
| 474 | } |
|
| 475 | $req = "SELECT p.pokemon_id, p.lat AS latitude, p.lon AS longitude, count(p.pokemon_id) AS total_pokemon, FROM_UNIXTIME(s.updated) as latest_seen, coalesce(duration,30)*60 as duration |
|
| 476 | FROM sightings p |
|
| 477 | INNER JOIN spawnpoints s ON (p.spawn_id = s.spawn_id) |
|
| 478 | WHERE p.expire_timestamp > UNIX_TIMESTAMP() - 86400 |
|
| 479 | " . $pokemon_exclude_sql . " |
|
| 480 | GROUP BY p.spawn_id, p.pokemon_id |
|
| 481 | HAVING COUNT(p.pokemon_id) >= 6 |
|
| 482 | ORDER BY p.pokemon_id"; |
|
| 483 | $result = $this->mysqli->query($req); |
|
| 484 | $nests = array(); |
|
| 485 | while ($data = $result->fetch_object()) { |
|
| 486 | $nests[] = $data; |
|
| 487 | } |
|
| 488 | return $nests; |
|
| 489 | } |
|
| 490 | ||
| 491 | } |
|
| @@ 579-598 (lines=20) @@ | ||
| 576 | return $data; |
|
| 577 | } |
|
| 578 | ||
| 579 | public function getNestData() { |
|
| 580 | $pokemon_exclude_sql = ""; |
|
| 581 | if (!empty(self::$config->system->nest_exclude_pokemon)) { |
|
| 582 | $pokemon_exclude_sql = "AND p.pokemon_id NOT IN (".implode(",", self::$config->system->nest_exclude_pokemon).")"; |
|
| 583 | } |
|
| 584 | $req = "SELECT p.pokemon_id, max(p.latitude) AS latitude, max(p.longitude) AS longitude, count(p.pokemon_id) AS total_pokemon, s.latest_seen, (LENGTH(s.kind) - LENGTH( REPLACE ( kind, \"s\", \"\") )) * 900 AS duration |
|
| 585 | FROM pokemon p |
|
| 586 | INNER JOIN spawnpoint s ON (p.spawnpoint_id = s.id) |
|
| 587 | WHERE p.disappear_time > UTC_TIMESTAMP() - INTERVAL 24 HOUR |
|
| 588 | " . $pokemon_exclude_sql . " |
|
| 589 | GROUP BY p.spawnpoint_id, p.pokemon_id |
|
| 590 | HAVING COUNT(p.pokemon_id) >= 6 |
|
| 591 | ORDER BY p.pokemon_id"; |
|
| 592 | $result = $this->mysqli->query($req); |
|
| 593 | $nests = array(); |
|
| 594 | while ($data = $result->fetch_object()) { |
|
| 595 | $nests[] = $data; |
|
| 596 | } |
|
| 597 | return $nests; |
|
| 598 | } |
|
| 599 | ||
| 600 | } |
|