From e9a27be9df6c32e0c977b52ac961fbe8a9613679 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 19 Nov 2019 11:52:06 +0800 Subject: [PATCH] =?UTF-8?q?TPI=E7=8E=A9=E7=9A=84=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/models/game.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 1a6fe8ac7..23c72c5dc 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -769,7 +769,7 @@ class GamesController < ApplicationController def cost_time #return if @game.status >= 2 cost_time = (Time.now.to_i - @game.play_time.to_i) + @game.cost_time.to_i - @game.update_attributes(play_time: Time.now, cost_time: cost_time, play_sign: 0) + @game.update_attributes(cost_time: cost_time, play_sign: 0) end # 同步challenge的更新时间 diff --git a/app/models/game.rb b/app/models/game.rb index 7aa2e7264..d82392a59 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -3,7 +3,7 @@ # modify_time: 与challenges表的modify_time联合使用,2个字段一致,则标识测试集未修改,反之,被修改 # answer_open: 查看查看答案的深度, 0: 未查看过答案, 其他数值与challenge_answer的level值相关 # answer_deduction: 查看答案扣分的百分比;如 查看答案 扣除70% -# +#play_sign 与play_time: sign记录浏览器是否正常关闭, 0表示正常,1表示非正常; play_time:表示游玩时间 class Game < ApplicationRecord default_scope { order("games.created_at desc") }