mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 20:23:46 +08:00
🐛 Fix statistics error in SQLite
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user