Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hjm
cxt 6 years ago
commit 311bdc0932

@ -0,0 +1,41 @@
# bundle exec rake sync:public_message args=149,2903
namespace :sync do
task :public_message => :environment do
subject_id = ENV['args'].split(",")[0] # 对应课程的id
board_id = ENV['args'].split(",")[1]
message_id = ENV['args'].split(",")[2]
status = ENV['args'].split(",")[3] # 表示相应的期数
if status.to_i == 1
start_time = '2018-12-16'
end_time = '2019-04-01'
elsif status.to_i == 2
start_time = '2019-04-07'
end_time = '2019-07-28'
else
# 这种情况是取所有的
start_time = '2015-01-01'
end_time = '2022-07-28'
end
shixun_ids = Shixun.find_by_sql("select shixun_id from stage_shixuns where stage_id in (select id from stages where
subject_id=#{subject_id}) ").map(&:shixun_id)
discusses = Discuss.where(dis_id: shixun_ids).where("created_at >? and created_at <?", start_time, end_time)
board = Board.find(board_id)
message = Message.find(message_id)
if discusses.present?
discusses.find_each do |discuss|
puts discuss.user_id
puts discuss.content
Message.create!(board: board, root_id: message.root_id || message.id,
author: discuss.user_id, parent: message,
message_detail_attributes: {
content: discuss.try(:content)
})
end
end
end
end

@ -682,18 +682,22 @@ class Coursesleftnav extends Component{
if(result.source.droppableId==="shixun_homework"||result.source.droppableId==="graduation"||result.source.droppableId==="attachment"){
let url ="/course_second_categories/"+result.draggableId+"/move_category.json"
let url ="/course_second_categories/"+result.draggableId+"/move_category.json";
if(result.destination.index!=null){
this.droppablepost(url,result.destination.index+1)
}
}else if(result.source.droppableId==="board"){
let url ="/boards/"+result.draggableId+"/move_category.json"
this.droppablepost(url,result.destination.index+1)
let url ="/boards/"+result.draggableId+"/move_category.json";
if(result.destination.index!=null) {
this.droppablepost(url, result.destination.index + 1)
}
}else if(result.source.droppableId==="course_group"){
if(result.draggableId!=1){
let url ="/course_groups/"+result.draggableId+"/move_category.json"
this.droppablepost(url,result.destination.index+1)
let url ="/course_groups/"+result.draggableId+"/move_category.json";
if(result.destination.index!=null) {
this.droppablepost(url, result.destination.index + 1)
}
}
}

Loading…
Cancel
Save