|
|
|
@ -361,15 +361,16 @@ class FilesController < ApplicationController
|
|
|
|
|
def publish_params
|
|
|
|
|
tip_exception("缺少发布参数") if params[:delay_publish].blank?
|
|
|
|
|
@unified_setting = 1
|
|
|
|
|
if params[:delay_publish].to_i == 1 && @course.course_group_module? && @course.course_groups_count != 0
|
|
|
|
|
tip_exception("分班发布设置不能为空") if params[:group_settings].blank?
|
|
|
|
|
min_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).min
|
|
|
|
|
max_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).max
|
|
|
|
|
tip_exception("分班发布设置不能为空") if min_publish_time.blank?
|
|
|
|
|
|
|
|
|
|
# 分班设置中的时间一样且包含所有分班 则按统一设置处理,否则是非统一设置
|
|
|
|
|
@unified_setting = 0 unless min_publish_time == max_publish_time && params[:group_settings].pluck(:group_id).flatten.sort == @course.course_groups.pluck(:id).sort
|
|
|
|
|
elsif params[:delay_publish].to_i == 1
|
|
|
|
|
# if params[:delay_publish].to_i == 1 && @course.course_group_module? && @course.course_groups_count != 0
|
|
|
|
|
# tip_exception("分班发布设置不能为空") if params[:group_settings].blank?
|
|
|
|
|
# min_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).min
|
|
|
|
|
# max_publish_time = params[:group_settings].pluck(:publish_time).reject(&:blank?).max
|
|
|
|
|
# tip_exception("分班发布设置不能为空") if min_publish_time.blank?
|
|
|
|
|
#
|
|
|
|
|
# # 分班设置中的时间一样且包含所有分班 则按统一设置处理,否则是非统一设置
|
|
|
|
|
# @unified_setting = 0 unless min_publish_time == max_publish_time && params[:group_settings].pluck(:group_id).flatten.sort == @course.course_groups.pluck(:id).sort
|
|
|
|
|
# els
|
|
|
|
|
if params[:delay_publish].to_i == 1
|
|
|
|
|
tip_exception("缺少延期发布的时间参数") if params[:publish_time].blank?
|
|
|
|
|
min_publish_time = params[:publish_time]
|
|
|
|
|
end
|
|
|
|
|