Commit 0b98ffbb authored by hujiebin's avatar hujiebin

Update rank.go

parent db47bb04
...@@ -42,7 +42,7 @@ func PageCpDayRank(model *domain.Model, beginDate, endDate string, offset, limit ...@@ -42,7 +42,7 @@ func PageCpDayRank(model *domain.Model, beginDate, endDate string, offset, limit
var ranks []CpDayRank var ranks []CpDayRank
if err := model.DB().Table("cp_day_rank r").Joins("INNER JOIN cp_relation c ON c.id = r.cp_id"). if err := model.DB().Table("cp_day_rank r").Joins("INNER JOIN cp_relation c ON c.id = r.cp_id").
Where("r.date BETWEEN ? AND ?", beginDate, endDate).Group("cp_id").Select("cp_id,r.user_id1,r.user_id2,SUM(r.score) score"). Where("r.date BETWEEN ? AND ?", beginDate, endDate).Group("cp_id").Select("cp_id,r.user_id1,r.user_id2,SUM(r.score) score").
Order("r.score DESC").Offset(offset).Limit(limit).Find(&ranks).Error; err != nil { Order("score DESC").Offset(offset).Limit(limit).Find(&ranks).Error; err != nil {
model.Log.Errorf("PageCpDayRank fail:%v", err) model.Log.Errorf("PageCpDayRank fail:%v", err)
} }
return ranks return ranks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment