mirror of
https://github.com/muety/wakapi.git
synced 2025-12-05 22:20:24 -08:00
fix: project stats query for postgres (resolve #531)
This commit is contained in:
@@ -233,11 +233,11 @@ func (r *HeartbeatRepository) GetUserProjectStats(user *models.User, from, to ti
|
||||
"where user_id = ? and project != '' "+
|
||||
"and time between ? and ? "+
|
||||
"and language is not null and language != '' and project != '' "+
|
||||
"group by project "+
|
||||
"group by project, user_id "+
|
||||
"order by last desc "+
|
||||
"limit ? offset ? "+
|
||||
") "+
|
||||
"select distinct project, first, last, cnt as count, first_value(language) over (partition by project order by count(*) desc) as top_language "+
|
||||
"select distinct project, min(first) as first, min(last) as last, min(cnt) as count, first_value(language) over (partition by project order by count(*) desc) as top_language "+
|
||||
"from heartbeats "+
|
||||
"inner join projects using (project, user_id) "+
|
||||
"group by project, language "+
|
||||
|
||||
Reference in New Issue
Block a user