Origami update commit

This commit is contained in:
Cherry
2017-06-01 09:27:37 +06:30
parent 44e7d2452f
commit 47469cf466
5 changed files with 101 additions and 161 deletions

View File

@@ -33,4 +33,10 @@ class OrderItem < ApplicationRecord
end
#Origami : Cashier : to show order items details
def self.get_order_items_details(order_id)
order_details = OrderItem.select("order_items.item_name,order_items.qty,order_items.price,(order_items.qty*order_items.price) as total_price")
.joins("left join orders on orders.id = order_items.order_id")
.where("order_items.order_id=?",order_id)
end
end