Created
July 24, 2014 11:16
-
-
Save anonymous/bb9b75d12b55bd39cb41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search_all = LOCAL_SETTINGS["single_site_search"] | |
# actaully do the search - and get a list of id's | |
if params[:ref].to_s.length > 0 | |
if search_all | |
session[:search_cond] = ["spaces.id = ? and spaces.parent_id IS NULL", params[:ref]] | |
else | |
session[:search_cond] = ["spaces.id = ? and companies.parent_id = ? and spaces.parent_id IS NULL", params[:ref], current_company_id] | |
end | |
render :partial=>'call_centre_results' | |
return | |
end | |
if params[:member_reference].to_s.length > 0 | |
sd = SpaceDetail.where(value: params[:member_reference]) | |
if search_all | |
arr = [] | |
sd.each do |s| | |
arr << s.space.id if s.space.present? | |
if s.member | |
s.member.spaces.each do |x| | |
arr << x.id | |
end | |
end | |
end | |
session[:search_cond] = ["spaces.id = ? and companies.parent_id = ? ", arr, current_company_id] | |
else | |
arr = [] | |
sd.each do |s| | |
arr << s.space.id if s.space.present? | |
if s.member | |
s.member.spaces.each do |x| | |
arr << x.id | |
end | |
end | |
end | |
session[:search_cond] = ["spaces.id = ? and companies.parent_id = ? ", arr, current_company_id] | |
end | |
render :partial=>'call_centre_results' | |
return | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mysql2::Error: Operand should contain 1 column(s): SELECT COUNT(DISTINCT `spaces`.`id`) FROM `spaces` LEFT OUTER JOIN `slots` ON `slots`.`id` = `spaces`.`slot_id` LEFT OUTER JOIN `companies` ON `companies`.`id` = `slots`.`company_id` WHERE (spaces.id = 3556045,3584098 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment