commit
8081759f9e
|
|
@ -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 最高分
|
||||
|
|
|
|||
Loading…
Reference in New Issue