From bea09a024bac3a5968cacc64ad243ac05072e571 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 09:20:22 +0800 Subject: [PATCH 1/2] VNC --- app/controllers/shixuns_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 59dd20633..f58235ac4 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -467,7 +467,13 @@ class ShixunsController < ApplicationController def update_learn_setting begin ActiveRecord::Base.transaction do - @shixun.update_attributes!(shixun_params.merge(vnc_evaluate: 1)) + update_params = + if params[:shixun][:vnc].to_i == 1 + shixun_params.merge(vnc_evaluate: 1) + else + shixun_params + end + @shixun.update_attributes!(update_params) end rescue => e uid_logger_error("实训学习页面设置失败--------#{e.message}") From a0ce273cac62f821693475146d9cd90b7306e227 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 09:24:10 +0800 Subject: [PATCH 2/2] 1 --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f58235ac4..bb475abcd 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -468,7 +468,7 @@ class ShixunsController < ApplicationController begin ActiveRecord::Base.transaction do update_params = - if params[:shixun][:vnc].to_i == 1 + if params[:shixun][:vnc] shixun_params.merge(vnc_evaluate: 1) else shixun_params