Remove stat table
This commit is contained in:
@ -137,38 +137,6 @@ pub async fn bot_data(cookies: &CookieJar<'_>, pool: &State<Pool<MySql>>) -> Jso
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let history = sqlx::query_as_unchecked!(
|
||||
TimeFrame,
|
||||
"SELECT
|
||||
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(`utc_time`) / 86400) * 86400) AS `time_key`,
|
||||
COUNT(1) AS `count`
|
||||
FROM stat
|
||||
WHERE
|
||||
`utc_time` > DATE_SUB(NOW(), INTERVAL 31 DAY) AND
|
||||
`type` = 'reminder_sent'
|
||||
GROUP BY `time_key`
|
||||
ORDER BY `time_key`"
|
||||
)
|
||||
.fetch_all(pool.inner())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let history_failed = sqlx::query_as_unchecked!(
|
||||
TimeFrame,
|
||||
"SELECT
|
||||
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(`utc_time`) / 86400) * 86400) AS `time_key`,
|
||||
COUNT(1) AS `count`
|
||||
FROM stat
|
||||
WHERE
|
||||
`utc_time` > DATE_SUB(NOW(), INTERVAL 31 DAY) AND
|
||||
`type` = 'reminder_failed'
|
||||
GROUP BY `time_key`
|
||||
ORDER BY `time_key`"
|
||||
)
|
||||
.fetch_all(pool.inner())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let interval_count = sqlx::query!(
|
||||
"SELECT COUNT(1) AS count
|
||||
FROM reminders
|
||||
@ -206,10 +174,6 @@ pub async fn bot_data(cookies: &CookieJar<'_>, pool: &State<Pool<MySql>>) -> Jso
|
||||
"once": schedule_once_long,
|
||||
"interval": schedule_interval_long,
|
||||
},
|
||||
"historyLong": {
|
||||
"sent": history,
|
||||
"failed": history_failed,
|
||||
},
|
||||
"count": {
|
||||
"reminders": reminder_count.count,
|
||||
"intervals": interval_count.count,
|
||||
|
Reference in New Issue
Block a user