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

Commit

Permalink
Merge pull request #23 from plinytheelder/patch-2
Browse files Browse the repository at this point in the history
Don't double up Stats
  • Loading branch information
roundaboutluke authored Sep 16, 2024
2 parents 9fbf1f1 + 80960c3 commit f46f7f8
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 f46f7f8

Please sign in to comment.