diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 7e7b6e082..56c1d9347 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -454,7 +454,7 @@ class GamesController < ApplicationController begin @content = git_fle_content(@myshixun.repo_path, path) || "" rescue - if params[:retry].present? + if params[:retry].to_i == 1 begin begin # 检测TPM对应的路径代码是否正常 diff --git a/app/models/challenge.rb b/app/models/challenge.rb index ac031c31c..6dd93dcc0 100644 --- a/app/models/challenge.rb +++ b/app/models/challenge.rb @@ -77,14 +77,17 @@ class Challenge < ApplicationRecord def user_tpi_status user_id # todo: 以前没加索引导致相同关卡,同一用户有多个games # 允许跳关则直接开启 - return 1 if shixun.task_pass game = games.where(user_id: user_id).take if game.blank? self.position == 1 ? 1 : 0 elsif game.status == 2 2 else - 1 + if shixun.task_pass + 1 + else + 0 + end end end