mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 02:28:26 -04:00
pending count
This commit is contained in:
@@ -2,7 +2,7 @@ import uuid
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from sqlalchemy import Float, Integer, cast, delete, select
|
from sqlalchemy import Float, cast, delete, select
|
||||||
from sqlalchemy.orm import joinedload
|
from sqlalchemy.orm import joinedload
|
||||||
from sqlalchemy.sql.expression import and_, asc, case, func
|
from sqlalchemy.sql.expression import and_, asc, case, func
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date):
|
|||||||
total_substmt = (
|
total_substmt = (
|
||||||
select(
|
select(
|
||||||
func.date_trunc("day", NotificationAllTimeView.created_at).label("day"),
|
func.date_trunc("day", NotificationAllTimeView.created_at).label("day"),
|
||||||
cast(Job.notification_count, Integer).label("notification_count")
|
Job.notification_count.label("notification_count")
|
||||||
)
|
)
|
||||||
.join(
|
.join(
|
||||||
Job, NotificationAllTimeView.job_id == Job.id
|
Job, NotificationAllTimeView.job_id == Job.id
|
||||||
@@ -497,7 +497,7 @@ def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date):
|
|||||||
NotificationAllTimeView.notification_type,
|
NotificationAllTimeView.notification_type,
|
||||||
NotificationAllTimeView.status,
|
NotificationAllTimeView.status,
|
||||||
func.date_trunc("day", NotificationAllTimeView.created_at).label("day"),
|
func.date_trunc("day", NotificationAllTimeView.created_at).label("day"),
|
||||||
cast(func.count(NotificationAllTimeView.id), Integer).label("count"),
|
func.count(NotificationAllTimeView.id).label("count"),
|
||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
NotificationAllTimeView.service_id == service_id,
|
NotificationAllTimeView.service_id == service_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user