This commit is contained in:
BoHung Chiu 2023-08-04 09:18:49 +08:00
parent 7b31273523
commit 6c9cb2b23d
1 changed files with 4 additions and 2 deletions

View File

@ -126,7 +126,9 @@ class AsiaDatabasesController < ApplicationController
asia_data = asia_data.page(params[:page_no]).per(OrbitHelper.page_data_count) asia_data = asia_data.page(params[:page_no]).per(OrbitHelper.page_data_count)
end end
asia_data_list = [] asia_data_list = []
if !params['keywords'].nil? if params['keywords'].nil?
asia_data = nil
else
if for_frontend if for_frontend
asia_data_list = asia_data.collect do |asia_record| asia_data_list = asia_data.collect do |asia_record|
{'jps' => fields_to_show.map{|field| {"value"=> get_display_field(asia_record,field)}}} {'jps' => fields_to_show.map{|field| {"value"=> get_display_field(asia_record,field)}}}
@ -178,7 +180,7 @@ class AsiaDatabasesController < ApplicationController
"asia_databases" => asia_data_list, "asia_databases" => asia_data_list,
"headers" => table_headers, "headers" => table_headers,
"extras" => extras, "extras" => extras,
"total_pages" => asia_data.total_pages, "total_pages" => (asia_data ? asia_data.total_pages : 0),
'choice_unit' => choice_unit, 'choice_unit' => choice_unit,
'choice_field' => choice_field 'choice_field' => choice_field
} }