From d26c4a62ba116110fcf86f8d6db2b5f459aa83ae Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Mon, 11 Mar 2019 08:43:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=8D=B4=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=BE=97=E5=88=B0=E9=87=91=E5=B8=81=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From fa1af83d6d941405edc23f87b40fa77337d02bb3 Mon Sep 17 00:00:00 2001 From: daiao <35855898@qq.com> Date: Mon, 11 Mar 2019 09:08:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=82=E8=80=83=E7=AD=94=E6=A1=88?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/games_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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