From 2c48a24f485a98a329b7b69138841f3dbf2bbf90 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 27 Jun 2019 18:12:04 +0800 Subject: [PATCH] 1 --- app/controllers/games_controller.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 00760209e..ac0b6baa8 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -344,17 +344,7 @@ class GamesController < ApplicationController @game.update_attribute(:test_sets_view, true) # 扣分记录 Grade.create(:user_id => current_user.id, :container_id => @game.id, :score => -@minus_grade, :container_type => "testSet") - max_query_index = game.query_index.to_i - # 区分评测过未评测过,未评测过按需求取数据 - if max_query_index > 0 - qurey_test_sets = TestSet.find_by_sql("SELECT o.code, 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 - qurey_test_sets = TestSet.find_by_sql("SELECT t.is_public,t.input, t.output,t.position FROM games g ,challenges c,test_sets t where - g.id=#{game.id} and c.id= g.challenge_id and t.challenge_id = c.id - ") - end + max_query_index = @game.query_index.to_i testset_detail max_query_index, challenge else tip_exception(-1, "本操作需要扣除#{ @minus_grade }金币,您的金币不够了")