开启时间第一次进入的时间

dev_aliyun_beta
daiao 5 years ago
parent fd4e6e4177
commit 058118a4f9

@ -916,7 +916,8 @@ class GamesController < ApplicationController
# 更新关卡状态和一些学习进度
def update_game_parameter game
game.update_attribute(:status, 0) if game.status == 1
game.update_attributes(status: 0, open_time: Time.now) if game.status == 3
# 第一次进入关卡更新时间
game.update_attributes(status: 0, open_time: Time.now) if game.open_time.blank?
# 开启实训更新myshixuns的时间方便跟踪用于的学习进度。
game.myshixun.update_column(:updated_at, Time.now)
end

@ -601,7 +601,7 @@ class ShixunsController < ApplicationController
challenges.each_with_index do |challenge, index|
status = (index == 0 ? 0 : 3)
game_identifier = generate_identifier(Game, 12)
worker.add(base_attr.merge(challenge_id: challenge.id, status: status, open_time: Time.now,
worker.add(base_attr.merge(challenge_id: challenge.id, status: status,
identifier: game_identifier, modify_time: challenge.modify_time))
end
end

Loading…
Cancel
Save