parent
61cf664f6d
commit
d889ff7877
@ -1,5 +1,6 @@
|
|||||||
json.extract! video, :id, :title, :cover_url, :file_url
|
json.extract! video, :id, :title, :cover_url, :file_url, :vv
|
||||||
|
|
||||||
|
json.play_duration video.video_play_duration
|
||||||
json.published_at video.display_published_at
|
json.published_at video.display_published_at
|
||||||
json.created_at video.display_created_at
|
json.created_at video.display_created_at
|
||||||
json.updated_at video.display_updated_at
|
json.updated_at video.display_updated_at
|
@ -0,0 +1,6 @@
|
|||||||
|
class AddNewColumnToVideos < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :videos, :vv, :integer, default: 0
|
||||||
|
add_column :videos, :play_duration, :integer, default: 0
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,14 @@
|
|||||||
|
namespace :video do
|
||||||
|
desc "get video play data"
|
||||||
|
task :data => :environment do
|
||||||
|
start_time = [Time.utc(2019,8,19,0,0,0), Time.utc(2019,11,10,0,0,0)]
|
||||||
|
end_time = [Time.utc(2019,11,09,23,59,59), Time.utc(2020,2,6,23,59,59)]
|
||||||
|
|
||||||
|
Video.all.each do |video|
|
||||||
|
vv = 0
|
||||||
|
play_duration = 0
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue