考试模式

dev_local
jingquan huang 6 years ago
parent 5c826a8e54
commit d8a8e12f4d

@ -61,6 +61,12 @@ class LocalSettingsController < ApplicationController
respond_to do |format|
if @local_setting.update_attributes(params[:local_setting])
if params[:local_setting][:exam] == "0"
Shixun.where(local_status: 2).update_all(status: 2, local_status: 0)
elsif params[:local_setting][:exam] == "1"
Shixun.where(status: 2).update_all(status: 0, local_status: 2)
end
format.html { redirect_to @local_setting, notice: 'Local setting was successfully updated.' }
format.json { head :no_content }
else

Loading…
Cancel
Save