fix(analyticsApi): fixed last_30_days_data (3)
Build and Push Docker image / build-and-push (push) Successful in 2m13s
Details
Build and Push Docker image / build-and-push (push) Successful in 2m13s
Details
This commit is contained in:
parent
db0e73b7b9
commit
059f473a38
|
@ -138,15 +138,20 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
|
||||||
(
|
(
|
||||||
SELECT json_group_array(
|
SELECT json_group_array(
|
||||||
json_object(
|
json_object(
|
||||||
'date', strftime('%Y-%m-%d', created),
|
'date', date,
|
||||||
'count', COUNT(id)
|
'count', daily_count
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
FROM analyticsPageViews
|
FROM (
|
||||||
WHERE
|
SELECT
|
||||||
path = view.path AND
|
strftime('%Y-%m-%d', created) AS date,
|
||||||
created >= datetime('now', '-30 days')
|
COUNT(id) AS daily_count
|
||||||
GROUP BY strftime('%Y-%m-%d', created)
|
FROM analyticsPageViews
|
||||||
|
WHERE
|
||||||
|
path = view.path AND
|
||||||
|
created >= datetime('now', '-30 days')
|
||||||
|
GROUP BY date
|
||||||
|
) AS daily_data
|
||||||
) AS last_30_days_data
|
) AS last_30_days_data
|
||||||
FROM
|
FROM
|
||||||
analyticsPageViews view
|
analyticsPageViews view
|
||||||
|
|
Loading…
Reference in New Issue