|
|
@ -3127,6 +3127,7 @@ end
|
|
|
|
notice = SystemUpdateNotice.last
|
|
|
|
notice = SystemUpdateNotice.last
|
|
|
|
if notice.present? && notice.end_time > Time.now
|
|
|
|
if notice.present? && notice.end_time > Time.now
|
|
|
|
notice.update_attributes(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes])
|
|
|
|
notice.update_attributes(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes])
|
|
|
|
|
|
|
|
UserSystemNotice.where(:notice_type => notice.notice_type).destroy_all
|
|
|
|
else
|
|
|
|
else
|
|
|
|
notice_type = UserSystemNotice.find_by_sql("select max(notice_type) as max_notice_type from user_system_notices").first.try(:max_notice_type).to_i + 1
|
|
|
|
notice_type = UserSystemNotice.find_by_sql("select max(notice_type) as max_notice_type from user_system_notices").first.try(:max_notice_type).to_i + 1
|
|
|
|
SystemUpdateNotice.create(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes], :notice_type => notice_type)
|
|
|
|
SystemUpdateNotice.create(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes], :notice_type => notice_type)
|
|
|
|