diff --git a/analyticsApi/main.go b/analyticsApi/main.go index 498372e..370aa5d 100644 --- a/analyticsApi/main.go +++ b/analyticsApi/main.go @@ -45,7 +45,7 @@ import ( // "count": , // "last_30_days_data": [ // { -// "date": , +// "date": YYYY-MM-DD, // "count": // }, // ... @@ -147,7 +147,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) { ) FROM ( SELECT - strftime('%Y-%m-%dT%H:%M:%SZ', created) AS date, + strftime('%Y-%m-%d', created) AS date, COUNT(id) AS daily_count FROM analyticsPageViews WHERE @@ -326,7 +326,7 @@ func initAggregateCount(app *pocketbase.PocketBase, e *core.ServeEvent) { // // [ // { -// "date": "", +// "date": "YYYY-MM-DD", // "error_count": , // "page_view_count": , // "unique_visitor_count": @@ -369,7 +369,7 @@ func initDailyAnalyticsAggregates(app *pocketbase.PocketBase, e *core.ServeEvent err = app.Dao().DB(). NewQuery(` SELECT - created AS date, + strftime('%Y-%m-%d', created) AS date, COUNT(id) AS page_view_count, SUM(CASE WHEN error IS NOT NULL THEN 1 ELSE 0 END) AS error_count, COUNT(DISTINCT visitor) AS unique_visitor_count