From 24ff3a1aa664201958e631b81a62aa4ec006cd71 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 3 Apr 2019 12:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=9B=86=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index 108cb93e..94ea2f6b 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -91,7 +91,7 @@ class GamesService sql = if max_query_index > 0 "SELECT - b.actual_output, b.out_put, b.result, a.is_public, a.input, a.output + b.actual_output, b.out_put, b.result, b.compile_success, a.is_public, a.input, a.output FROM (SELECT position, input, output, challenge_id, is_public FROM test_sets where challenge_id=#{game_challenge.id}) a LEFT JOIN @@ -316,7 +316,7 @@ class GamesService max_query_index = game.query_index - 1 # 区分评测过未评测过,未评测过按需求取数据 if max_query_index > 0 - qurey_test_sets = TestSet.find_by_sql("SELECT o.actual_output, o.out_put, o.result, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where + qurey_test_sets = TestSet.find_by_sql("SELECT o.actual_output, o.out_put, o.result, o.compile_success, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where g.id=#{game.id} and o.query_index=#{max_query_index} and g.id = o.game_id and c.id= g.challenge_id and t.challenge_id = c.id and t.position =o.test_set_position order by o.query_index ") else @@ -836,7 +836,7 @@ class GamesService max_query_index = game.query_index - 1 # 区分评测过未评测过,未评测过按需求取数据 if max_query_index > 0 - qurey_test_sets = TestSet.find_by_sql("SELECT o.actual_output,o.result, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where + qurey_test_sets = TestSet.find_by_sql("SELECT o.actual_output,o.result, o.compile_success, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where g.id=#{game.id} and o.query_index=#{max_query_index} and g.id = o.game_id and c.id= g.challenge_id and t.challenge_id = c.id and t.position =o.test_set_position order by o.query_index ") else