🐛 Fix statistics error in SQLite
This commit is contained in:
parent
f823581235
commit
be613883a1
@ -200,6 +200,10 @@ func SearchLogsByDayAndModel(user_id, start, end int) (LogStatistics []*LogStati
|
|||||||
groupSelect = "TO_CHAR(date_trunc('day', to_timestamp(created_at)), 'YYYY-MM-DD') as day"
|
groupSelect = "TO_CHAR(date_trunc('day', to_timestamp(created_at)), 'YYYY-MM-DD') as day"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if common.UsingSQLite {
|
||||||
|
groupSelect = "strftime('%Y-%m-%d', datetime(created_at, 'unixepoch')) as day"
|
||||||
|
}
|
||||||
|
|
||||||
err = DB.Raw(`
|
err = DB.Raw(`
|
||||||
SELECT `+groupSelect+`,
|
SELECT `+groupSelect+`,
|
||||||
model_name, count(1) as request_count,
|
model_name, count(1) as request_count,
|
||||||
|
Loading…
Reference in New Issue
Block a user