diff --git a/src/velofy/db/cities.py b/src/velofy/db/cities.py index ef58531..a779efc 100644 --- a/src/velofy/db/cities.py +++ b/src/velofy/db/cities.py @@ -185,13 +185,13 @@ class City(meta.Base): ) if order_counts: - # Calculate the number of orders for ALL restaurants ... + # Several restaurants may share an address + # => Count the orders of all of them n_orders = db.session.execute( sa.select(sa.func.count(db.Order.id)) .join(db.Address, db.Order.pickup_address_id == db.Address.id) .where(db.Address.primary_id == address.id), ).scalar_one() - # ... and adjust the size of the red dot on the `.map` if n_orders >= 1000: radius = 20 elif n_orders >= 500: