From cacf0f135413b6f9dcdea24b3814480bf5aca3a9 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Mar 2017 15:59:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 ++++ app/views/games/_games_list.html.erb | 2 +- app/views/myshixuns/_myshixun_top.html.erb | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c207b827d..89f92eba1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -95,6 +95,10 @@ module ApplicationHelper Output.where(:game_id => game).count end + def shixun_final_score myshixun + Game.find_by_sql("SELECT sum(final_score) as score FROM `games` where myshixun_id='#{myshixun.id}';") + end + # def user_blogs_path(resource,parameters={}) # super # end diff --git a/app/views/games/_games_list.html.erb b/app/views/games/_games_list.html.erb index 190f16a0e..7235e534b 100644 --- a/app/views/games/_games_list.html.erb +++ b/app/views/games/_games_list.html.erb @@ -36,7 +36,7 @@

开始时间:<%= format_time(game.created_at) %> 完成时间:<%= format_time(game.updated_at) %> - 耗时:<%= game_avg_day(game.created_at, game.updated_at) %>天<%= game_avg_hour(game.created_at, game.updated_at) %>小时<%= game_avg_min(game.created_at, game.updated_at) %>分 + 耗时:<%= game_avg_hour(game.created_at, game.updated_at) %>小时<%= game_avg_min(game.created_at, game.updated_at) %>分 测评次数:<%= avg_my_pass game %>次 得分:<%= game.final_score %>分

diff --git a/app/views/myshixuns/_myshixun_top.html.erb b/app/views/myshixuns/_myshixun_top.html.erb index 4a2820ef1..21a9a4bfa 100644 --- a/app/views/myshixuns/_myshixun_top.html.erb +++ b/app/views/myshixuns/_myshixun_top.html.erb @@ -3,8 +3,8 @@ 暂时离开