사이트 코드와 홈페이지 위젯 추가 v1.5.34
This commit is contained in:
@@ -542,6 +542,8 @@ export const getAnalyticsSummary = async (options = {}) => {
|
||||
if (!sql) {
|
||||
return {
|
||||
todayVisitors: 0,
|
||||
todayPageViews: 0,
|
||||
todayAvgEngagedSeconds: 0,
|
||||
visitorsLast7Days: 0,
|
||||
pageViewsLast30Days: 0,
|
||||
onlineNow: 0,
|
||||
@@ -630,9 +632,15 @@ export const getAnalyticsSummary = async (options = {}) => {
|
||||
|
||||
const engagedViews = Number(engagementRows[0]?.engaged_views || 0)
|
||||
const totalEngagedSeconds = Number(engagementRows[0]?.total_engaged_seconds || 0)
|
||||
const todayEngagedViews = Number(todayRows[0]?.engaged_views || 0)
|
||||
const todayTotalEngagedSeconds = Number(todayRows[0]?.total_engaged_seconds || 0)
|
||||
|
||||
return {
|
||||
todayVisitors: Number(todayRows[0]?.visitors || 0),
|
||||
todayPageViews: Number(todayRows[0]?.page_views || 0),
|
||||
todayAvgEngagedSeconds: todayEngagedViews > 0
|
||||
? Math.round(todayTotalEngagedSeconds / todayEngagedViews)
|
||||
: 0,
|
||||
visitorsLast7Days: Number(last7Rows[0]?.visitors || 0),
|
||||
pageViewsLast30Days: Number(pageViewRows[0]?.page_views || 0),
|
||||
onlineNow: Number(onlineRows[0]?.online_now || 0),
|
||||
|
||||
Reference in New Issue
Block a user