singleScrape_of_region eingefügt
parent
67c0d85213
commit
c059890ba7
|
@ -443,6 +443,21 @@ class Database:
|
|||
properties.seed_id = {region_id}
|
||||
""")
|
||||
|
||||
def singleScrape_of_region(self, region_id: int, scrape_date_min: str, scrape_date_max: str):
|
||||
return self.connection.sql(f"""
|
||||
SELECT
|
||||
JSON_EXTRACT(body, '$.content.days') as calendarBody,
|
||||
FROM
|
||||
consultancy_d.extractions
|
||||
LEFT JOIN
|
||||
consultancy_d.properties ON properties.id = extractions.property_id
|
||||
WHERE
|
||||
type == 'calendar' AND
|
||||
properties.seed_id = {region_id} AND
|
||||
extractions.created_at >= '{scrape_date_min}' AND
|
||||
extractions.created_at < '{scrape_date_max}'
|
||||
""")
|
||||
|
||||
def capacity_global(self):
|
||||
return self.connection.sql(f"""
|
||||
SELECT
|
||||
|
|
Loading…
Reference in New Issue