diff --git a/model/log.go b/model/log.go index a8699673..f3858c3b 100644 --- a/model/log.go +++ b/model/log.go @@ -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" } + if common.UsingSQLite { + groupSelect = "strftime('%Y-%m-%d', datetime(created_at, 'unixepoch')) as day" + } + err = DB.Raw(` SELECT `+groupSelect+`, model_name, count(1) as request_count,