|
|
|
@ -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
|
|
|
|
|