修正耗时不准的问题

dev_aliyun2
daiao 5 years ago committed by harry
parent 3da96e7485
commit a113c1666c

@ -0,0 +1,18 @@
#coding=utf-8
desc "纠正学生实训耗时不准的问题"
namespace :shixuns do
task correct_the_shixun_cost_time: :environment do
puts "myshixun_id: #{ENV['myshixun_id']}"
if ENV['myshixun_id'].present?
myshixun = Myshixun.find(ENV['myshixun_id'])
myshixun.games.where(status: 2).each do |game|
cost_time = game.open_time.to_i - game.end_time.to_i
game.update_column(:cost_time, cost_time)
end
end
end
end
Loading…
Cancel
Save