0
我不知道我在哪里错了。 '主'是所有工作的完整列表。然后我为不同的door_manufacturer
设置了三个过滤器。有些门票有parts_mfr
,如果它与manufacturing_location
相同,我需要提取。我很困惑。再次,我不知道我在这里错过了什么。复杂的钢轨查询
session[:door_location] = params[:location] || session[:door_location] || 'MASTER'
if session[:door_location] == 'MASTER'
@tickets = Ticket.where(active: true,
complete_in_shop: false,
manufacturing_location: session[:factory]).
order(calendar_date: :asc).order(:calendar_order).
limit(90)
else
tickets_door_location = Ticket.where(active: true, complete_in_shop: false,
manufacturing_location: session[:factory])
tickets_parts_location = Ticket.where(active: true, complete_in_shop: false,
parts_mfr: session[:door_location])
@tickets = (tickets_door_location << tickets_parts_location).
order(calendar_date: :asc).order(:calendar_order).
limit(90)
end