From 4c90086190b49683a4a75a1de8f404772e94bdb4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 29 Sep 2019 09:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E9=80=9A=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index be8173b2f..8a3999410 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -657,7 +657,8 @@ class GamesController < ApplicationController # 高性能取上一关、下一关 prev_game = @game.prev_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) - next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) if had_passed + next_game = @game.next_game(@shixun.id, @game.myshixun_id, game_challenge.position) if had_passed + next_game.update_column(:status, 0) if next_game.present? && next_game.status == 3 # 高性能取上一关、下一关 #prev_game = Game.prev_identifier(@shixun.id, @game.myshixun_id, game_challenge.position) @@ -670,7 +671,7 @@ class GamesController < ApplicationController choose_correct_num: choose_correct_num, test_sets: test_sets, prev_game: prev_game, - next_game: next_game} + next_game: next_game&.identifier} rescue Exception => e uid_logger("choose build failed #{e.message}") @result = [status: -1, contents: "#{e.message}"]