立即发布时截止时间未变

dev_course
cxt 6 years ago
parent 29b8279db6
commit b4fa106873

@ -907,10 +907,9 @@ class HomeworkCommonsController < ApplicationController
# 创建作业分班设置homework_group_setting
create_homework_group_settings(homework)
# 选中的分班设置的发布时间改为当前时间,截止时间不为空的保持原状,为空的改为一个月后
homework.homework_group_settings.where(course_group_id: publish_groups).update_all(publish_time: Time.now)
homework.homework_group_settings.where(course_group_id: publish_groups, end_time: nil).
update_all(end_time: params[:end_time])
# 选中的分班设置的发布时间改为当前时间,截止时间改为传的截止时间参数
homework.homework_group_settings.where(course_group_id: publish_groups).update_all(publish_time: Time.now,
end_time: params[:end_time])
# 发消息
tiding_group_ids = publish_groups
end
@ -938,8 +937,7 @@ class HomeworkCommonsController < ApplicationController
create_homework_group_settings(homework)
none_publish_settings = homework.homework_group_settings.where(course_group_id: publish_groups).none_published
none_publish_settings.update_all(publish_time: Time.now)
none_publish_settings.where(end_time: nil).update_all(end_time: params[:end_time])
none_publish_settings.update_all(publish_time: Time.now, end_time: params[:end_time])
if homework.max_group_end_time
homework.end_time = homework.max_group_end_time
end

Loading…
Cancel
Save