Add comments and tweak formatting

This commit is contained in:
Alex Cabal 2025-05-23 10:51:19 -05:00
parent f6aef54767
commit 2122b0f625
2 changed files with 5 additions and 3 deletions

View file

@ -35,9 +35,9 @@ foreach($downloadDates as $date){
Db::Query('
UPDATE Ebooks e
left join (
select EbookId, sum(DownloadCount) AS DownloadsPast30Days
select EbookId, sum(DownloadCount) as DownloadsPast30Days
from EbookDownloadSummaries
where Date >= curdate() - interval 29 day
where Date >= date(utc_timetamp()) - interval 30 day
group by EbookId
) s on e.EbookId = s.EbookId
set e.DownloadsPast30Days = coalesce(s.DownloadsPast30Days, 0)
@ -46,7 +46,7 @@ Db::Query('
Db::Query('
UPDATE Ebooks e
left join (
select EbookId, sum(DownloadCount) AS DownloadsTotal
select EbookId, sum(DownloadCount) as DownloadsTotal
from EbookDownloadSummaries
group by EbookId
) s on e.EbookId = s.EbookId