修正games的耗时

dev_aliyun2
daiao 5 years ago committed by harry
parent d1c45b9152
commit 6fe02c6779

@ -9,11 +9,7 @@ namespace :shixuns do
if ENV['myshixun_id'].present? if ENV['myshixun_id'].present?
myshixun = Myshixun.find(ENV['myshixun_id']) myshixun = Myshixun.find(ENV['myshixun_id'])
myshixun.games.where(status: 2).each do |game| myshixun.games.where(status: 2).each do |game|
puts "open_time: #{game.open_time.to_i}" cost_time = game.end_time.to_i - game.open_time.to_i
puts "end_time: #{game.end_time.to_i}"
puts "game_id: #{game.id}"
cost_time = game.open_time.to_i - game.end_time.to_i
puts "cost_time: #{cost_time}"
game.update_column(:cost_time, cost_time) game.update_column(:cost_time, cost_time)
end end
end end

Loading…
Cancel
Save