fix error

This commit is contained in:
chiu 2022-10-15 11:45:37 +08:00
parent b1d010d001
commit 688449f3f0
1 changed files with 6 additions and 2 deletions

View File

@ -157,8 +157,12 @@ class Admin::AsksController < OrbitAdminController
@table_fields = @ask_list_setting.default_fields.select{|f| @ask_setting.default_setting[f].nil? || @ask_setting.default_setting[f] }
if @category_id.present?
ask_setting = AskCategorySetting.where(:category_id=>@category_id, :use_default.ne=>true).first
ask_setting = AskSetting.first if ask_setting.nil?
tmp = ask_setting.custom_fields
if ask_setting.nil?
ask_setting = AskSetting.first
tmp = ask_setting.custom_fields.map{|k,v| ["default@#{k}", v]}
else
tmp = ask_setting.custom_fields.map{|k,v| ["custom@#{k}", v]}
end
list_setting_custom_fields = @ask_list_setting.custom_fields
else
tmp = []