mirror of
https://github.com/writeas/writefreely
synced 2024-12-11 16:18:07 +01:00
Merge pull request #769 from writefreely/fix-mau
Fix monthly active user stats
This commit is contained in:
commit
5d4ebb59c7
@ -94,14 +94,20 @@ INNER JOIN collections c
|
|||||||
ON collection_id = c.id
|
ON collection_id = c.id
|
||||||
WHERE collection_id IS NOT NULL
|
WHERE collection_id IS NOT NULL
|
||||||
AND updated > DATE_SUB(NOW(), INTERVAL 6 MONTH)) co`).Scan(&activeHalfYear)
|
AND updated > DATE_SUB(NOW(), INTERVAL 6 MONTH)) co`).Scan(&activeHalfYear)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Failed getting 6-month active user stats: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
err = r.db.QueryRow(`SELECT COUNT(*) FROM (
|
err = r.db.QueryRow(`SELECT COUNT(*) FROM (
|
||||||
SELECT DISTINCT collection_id
|
SELECT DISTINCT collection_id
|
||||||
FROM posts
|
FROM posts
|
||||||
INNER JOIN FROM collections c
|
INNER JOIN collections c
|
||||||
ON collection_id = c.id
|
ON collection_id = c.id
|
||||||
WHERE collection_id IS NOT NULL
|
WHERE collection_id IS NOT NULL
|
||||||
AND updated > DATE_SUB(NOW(), INTERVAL 1 MONTH)) co`).Scan(&activeMonth)
|
AND updated > DATE_SUB(NOW(), INTERVAL 1 MONTH)) co`).Scan(&activeMonth)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Failed getting 1-month active user stats: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodeinfo.Usage{
|
return nodeinfo.Usage{
|
||||||
|
Loading…
Reference in New Issue
Block a user