mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Adding group by clause to outer query for function.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -484,12 +484,19 @@ def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date):
|
||||
.subquery()
|
||||
)
|
||||
|
||||
stmt = select(
|
||||
func.sum(sub_stmt.notification_count).label("total_notifications"),
|
||||
sub_stmt.notification_type,
|
||||
sub_stmt.status,
|
||||
sub_stmt.day,
|
||||
func.sum(sub_stmt.count).label("count"),
|
||||
stmt = (
|
||||
select(
|
||||
func.sum(sub_stmt.notification_count).label("total_notifications"),
|
||||
sub_stmt.notification_type,
|
||||
sub_stmt.status,
|
||||
sub_stmt.day,
|
||||
func.sum(sub_stmt.count).label("count"),
|
||||
)
|
||||
.group_by(
|
||||
sub_stmt.notification_type,
|
||||
sub_stmt.status,
|
||||
sub_stmt.day,
|
||||
)
|
||||
)
|
||||
return db.session.execute(stmt).all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user