mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
group results by service using itertools
allows us to nicely reuse the existing format_statistics function
This commit is contained in:
@@ -187,6 +187,7 @@ def dao_fetch_todays_stats_for_all_services():
|
||||
return db.session.query(
|
||||
Notification.notification_type,
|
||||
Notification.status,
|
||||
Notification.service_id,
|
||||
func.count(Notification.id).label('count')
|
||||
).select_from(
|
||||
Service
|
||||
@@ -199,4 +200,6 @@ def dao_fetch_todays_stats_for_all_services():
|
||||
Notification.notification_type,
|
||||
Notification.status,
|
||||
Notification.service_id
|
||||
).order_by(
|
||||
Notification.service_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user