Time filtering of notifications
This commit is contained in:
parent
b0ffce05f0
commit
17a22caa5d
9 changed files with 291 additions and 10 deletions
|
|
@ -40,7 +40,7 @@ func notificationLog(notificationService *notification.Service, problemID int, e
|
|||
}
|
||||
}
|
||||
|
||||
func notificationsSent() (nss []NotificationSend, err error) {
|
||||
func notificationsSent(from, to time.Time) (nss []NotificationSend, err error) {
|
||||
var rows *sqlx.Rows
|
||||
rows, err = service.Db.Conn.Queryx(
|
||||
`
|
||||
|
|
@ -57,15 +57,20 @@ func notificationsSent() (nss []NotificationSend, err error) {
|
|||
ns.error::varchar,
|
||||
ns.acknowledged
|
||||
|
||||
FROM
|
||||
public.notification_send ns
|
||||
FROM public.notification_send ns
|
||||
INNER JOIN notification n ON ns.notification_id = n.id
|
||||
INNER JOIN problem p ON ns.problem_id = p.id
|
||||
INNER JOIN "trigger" t ON p.trigger_id = t.id
|
||||
WHERE
|
||||
ns.send >= $1 AND
|
||||
ns.send <= $2
|
||||
|
||||
ORDER BY
|
||||
send DESC
|
||||
`)
|
||||
`,
|
||||
from,
|
||||
to,
|
||||
)
|
||||
if err != nil {
|
||||
err = werr.Wrap(err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue