Merge branch 'master' into 'master'

添加实训统计信息接口



See merge request !26
This commit is contained in:
黄井泉 2017-10-17 09:25:28 +08:00
commit 8081759f9e
1 changed files with 2 additions and 2 deletions

View File

@ -375,12 +375,12 @@ module ApplicationHelper
# 定义实训相关方法
def sum_final_score
Game.find_by_sql("SELECT sum(final_score) as total_score FROM `games` where user_id=#{User.current.id}").first.try(:total_score)
Game.find_by_sql("SELECT sum(final_score) as total_score FROM `games` where user_id=#{User.current.id}").first
end
# 获取某个myshixun的得分
def sum_myshixun_score myshixun_id
Game.find_by_sql("SELECT sum(final_score) as total_score FROM `games` where myshixun_id=#{myshixun_id}").first.try(:total_score)
Game.find_by_sql("SELECT sum(final_score) as total_score FROM `games` where myshixun_id=#{myshixun_id}").first
end
# myshixun 最高分