Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
Don't double up Stats
Browse files Browse the repository at this point in the history
Finally had to update Golbat, and Porygon needs this change so it doesn't double up poke stats.
  • Loading branch information
plinytheelder authored Sep 12, 2024
1 parent 9fbf1f1 commit 80960c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func GetPokeStats(db *sqlx.DB) (PokeStats, error) {

err := db.Get(&pokeStats, `
SELECT
(SELECT COALESCE(SUM(count), 0) FROM pokemon_stats WHERE date = CURDATE()) AS scanned,
(SELECT COALESCE(SUM(count), 0) FROM pokemon_hundo_stats WHERE date = CURDATE()) AS hundo,
(SELECT COALESCE(SUM(count), 0) FROM pokemon_nundo_stats WHERE date = CURDATE()) AS nundo,
(SELECT COALESCE(SUM(count), 0) FROM pokemon_stats WHERE area = 'world' and date = CURDATE()) AS scanned,
(SELECT COALESCE(SUM(count), 0) FROM pokemon_hundo_stats WHERE area = 'world' and date = CURDATE()) AS hundo,
(SELECT COALESCE(SUM(count), 0) FROM pokemon_nundo_stats WHERE area = 'world' and date = CURDATE()) AS nundo,
(SELECT COALESCE(SUM(count), 0) FROM pokemon_shiny_stats WHERE date = CURDATE()) AS shiny,
(SELECT COUNT(DISTINCT pokemon_id) FROM pokemon_shiny_stats WHERE date = CURDATE()) AS shinyspecies
`)
Expand Down

0 comments on commit 80960c3

Please sign in to comment.