diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 808d2d4f..cf7e6ee9 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -510,7 +510,7 @@ class MyshixunsController < ApplicationController challenge.path.split(";").each do |path| game_passed_code(game.id, path, myshixun.try(:gpid), 1) end - if !game.answer_open == 1 && (challenge.shixun.try(:status) > 1) # 如果没有查看答案,则获得该关卡得分 + if game.answer_open == 0 && (challenge.shixun.try(:status) > 1) # 如果没有查看答案,则获得该关卡得分 reward_grade(game.user, game.id, 'Game', challenge.score) reward_experience(game.user, game.id, 'Game', challenge.score) game.update_attributes!(:final_score => challenge.score) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index d1baa8b3..0ed0cbe1 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -796,7 +796,7 @@ class GamesService if game_status == 2 # 通关 if shixun.status > 1 score = game.final_score # 查看答案的时候有对最终获得金币进行处理 - experience = game.answer_open ? 0 : game_challenge.score.to_i + experience = game.answer_open > 0 ? 0 : game_challenge.score.to_i else score = 0 experience = 0