迁移数据

video_transcode
daiao 5 years ago
parent d75d507ab3
commit bdb9e7b1ad

@ -9,7 +9,11 @@ namespace :shixuns do
if ENV['myshixun_id'].present?
myshixun = Myshixun.find(ENV['myshixun_id'])
myshixun.games.where(status: 2).each do |game|
puts "open_time: #{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)
end
end

Loading…
Cancel
Save