1
0
Fork 0
This commit is contained in:
Gregory Eremin 2015-03-08 22:29:25 +07:00
parent d40ed66668
commit 4ebcdb28c8
1 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ where
c.week >= :from and c.week >= :from and
c.week <= :to c.week <= :to
group by item group by item
order by %s desc` order by commits desc`
const orgActivityQuery = ` const orgActivityQuery = `
select select
@ -54,7 +54,7 @@ where
c.week >= :from and c.week >= :from and
c.week <= :to c.week <= :to
group by item, week group by item, week
order by week, %s desc` order by week, commite desc`
const teamTopQuery = ` const teamTopQuery = `
select select
@ -169,13 +169,13 @@ order by commits desc`
func StatOrgTop(p map[string]interface{}) (res []StatItem) { func StatOrgTop(p map[string]interface{}) (res []StatItem) {
defer measure("StatOrgTop", time.Now()) defer measure("StatOrgTop", time.Now())
mustSelectN(&res, fmt.Sprintf(orgTopQuery, p["item"], p["sort"]), p) mustSelectN(&res, fmt.Sprintf(orgTopQuery, p["item"]), p)
return return
} }
func StatOrgActivity(p map[string]interface{}) (res []StatPoint) { func StatOrgActivity(p map[string]interface{}) (res []StatPoint) {
defer measure("StatOrgActivity", time.Now()) defer measure("StatOrgActivity", time.Now())
mustSelectN(&res, fmt.Sprintf(orgActivityQuery, p["item"], p["sort"]), p) mustSelectN(&res, fmt.Sprintf(orgActivityQuery, p["item"]), p)
return return
} }
@ -187,7 +187,7 @@ func StatTeamTop(p map[string]interface{}) (res []StatItem) {
func StatTeamActivity(p map[string]interface{}) (res []StatPoint) { func StatTeamActivity(p map[string]interface{}) (res []StatPoint) {
defer measure("StatTeamActivity", time.Now()) defer measure("StatTeamActivity", time.Now())
mustSelectN(&res, fmt.Sprintf(teamActivityQuery, p["item"], p["sort"]), p) mustSelectN(&res, fmt.Sprintf(teamActivityQuery, p["item"]), p)
return return
} }