|
|
|
@ -482,7 +482,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
publish_time = setting[:publish_time] == "" ? Time.now : setting[:publish_time]
|
|
|
|
|
# 截止时间为空时取发布时间后一个月
|
|
|
|
|
end_time = setting[:end_time] == "" ? Time.at(publish_time.to_time.to_i+30*24*3600) : setting[:end_time]
|
|
|
|
|
end_time = setting[:end_time]
|
|
|
|
|
HomeworkGroupSetting.where(homework_common_id: @homework.id, course_group_id: setting[:group_id]).
|
|
|
|
|
update_all(publish_time: publish_time, end_time: end_time)
|
|
|
|
|
setting_group_ids << setting[:group_id]
|
|
|
|
@ -1170,7 +1170,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
# 可立即截止的分班:统一设置则是用户管理的所有分班,否则是当前用户管理的分班中已发布且未截止的
|
|
|
|
|
charge_group_ids = @course.charge_group_ids(@current_user) # 当前用户管理的分班
|
|
|
|
|
group_ids = @homework.unified_setting ? charge_group_ids :
|
|
|
|
|
@homework.homework_group_settings.where(course_group_id: charge_group_ids).none_end.pluck(:course_group_id)
|
|
|
|
|
@homework.homework_group_settings.where(course_group_id: charge_group_ids).published_no_end.pluck(:course_group_id)
|
|
|
|
|
@course_groups = @course.course_groups.where(id: group_ids)
|
|
|
|
|
else
|
|
|
|
|
tip_exception("没有可截止的分班")
|
|
|
|
|