oqs print query update

This commit is contained in:
Yan
2017-06-06 10:25:14 +06:30
parent 820b1d5e96
commit 038a3c1696
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ class Oqs::PrintController < ApplicationController
def print
unique_code="OrderItemPdf"
assigned_item_id=params[:id]
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('assigned_order_item_id='+assigned_item_id)
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where("assigned_order_item_id='" + assigned_item_id + "'")
print_settings=PrintSetting.find_by_unique_code(unique_code)
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)

View File

@@ -29,7 +29,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
.joins("left join orders ON orders.order_id = order_items.order_id
left join booking_orders AS bo ON bo.order_id=order_items.order_id
left join bookings AS b ON b.booking_id = bo.booking_id
left join dining_facilities AS df ON df.dining_facility_id = b.dining_facility_id
left join dining_facilities AS df ON df.id = b.dining_facility_id
left join customers as cus ON cus.customer_id = orders.customer_id")
.where("order_items.item_code='" + code + "'")
.group("order_items.item_code")
@@ -38,7 +38,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
.joins("left join orders ON orders.order_id = order_items.order_id
left join booking_orders AS bo ON bo.order_id=order_items.order_id
left join bookings AS b ON b.booking_id = bo.booking_id
left join dining_facilities AS df ON df.dining_facility_id = b.dining_facility_id
left join dining_facilities AS df ON df.id = b.dining_facility_id
left join customers as cus ON cus.customer_id = orders.customer_id")
.where("orders.order_id='" + code.to_s + "'")
.group("order_items.item_code")