From 4264679c7be42d75b568047f8efb5b947e118062 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 25 Jun 2019 10:26:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 79167150e..9c3051796 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -613,13 +613,10 @@ class GamesController < ApplicationController end # 批量插入评测结果 - uid_logger("choose_build") + uid_logger("#------------chooice score: #{score}") sql = "INSERT INTO outputs (game_id, test_set_position, actual_output, result, query_index, created_at, updated_at) VALUES" + str ActiveRecord::Base.connection.execute sql - had_done = @game.had_done - @myshixun.update_attribute(:status, 1) if had_done == 1 - # 没通关或者查看了答案通关的时候经验为0 # 通关但是查看了答案,评测的时候金币显示0(避免用户以为重复扣除),但是在关卡列表中金币显示负数 experience = 0 @@ -638,6 +635,8 @@ class GamesController < ApplicationController final_score = score RewardExperienceService.call(@myshixun.owner, reward_attrs) end + had_done = @game.had_done + @myshixun.update_attribute(:status, 1) if had_done == 1 end grade = @myshixun.owner.try(:grade)