Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions util/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def get_shiny_total(mon_id, area, starttime, endtime, config):
if config['db_scan_schema'] == "mad":
query_total_shiny_count = f"select count(pokemon_id) from pokemon where pokemon_id={mon_id} and disappear_time > utc_timestamp() - INTERVAL 8 WEEK and individual_attack is not null AND ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(({area}))'), point(latitude, longitude)) AND disappear_time > convert_tz('{starttime}', '{config['timezone']}', '+00:00') AND disappear_time < convert_tz('{endtime}', '{config['timezone']}', '+00:00')"
elif config['db_scan_schema'] == "rdm":
query_total_shiny_count = f"SELECT count(pokemon_id) from pokemon WHERE where pokemon_id = {mon_id} and expire_timestamp > unix_timestamp() and atk_iv is not null AND ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(({area}))'), point(lat, lon)) and first_seen_timestamp > UNIX_TIMESTAMP(convert_tz('{starttime}', '{config['timezone']}', '+00:00')) AND first_seen_timestamp < UNIX_TIMESTAMP(convert_tz('{endtime}', '{config['timezone']}', '+00:00'))"
query_total_shiny_count = f"SELECT count(pokemon_id) from pokemon WHERE pokemon_id = {mon_id} and atk_iv is not null AND ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(({area}))'), point(lat, lon)) and first_seen_timestamp > UNIX_TIMESTAMP(convert_tz('{starttime}', '{config['timezone']}', '+00:00')) AND first_seen_timestamp < UNIX_TIMESTAMP(convert_tz('{endtime}', '{config['timezone']}', '+00:00'))"
await cursor_shiny_total.execute(query_total_shiny_count)
shiny_total = await cursor_shiny_total.fetchall()
for var in shiny_total:
Expand Down Expand Up @@ -218,4 +218,4 @@ async def statboard_quest_active(config, area):
statboard_quest_active = await cursor_statboard_quest_active.fetchall()

await cursor_statboard_quest_active.close()
return statboard_quest_active
return statboard_quest_active