迁移数据

dev_aliyun2
daiao 5 years ago committed by harry
parent a113c1666c
commit d1c45b9152

@ -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