tables origami

This commit is contained in:
Cherry
2017-05-31 18:19:17 +06:30
parent b3b2e9bd8d
commit 44e7d2452f
2 changed files with 34 additions and 26 deletions

View File

@@ -8,18 +8,16 @@ class Origami::HomeController < BaseOrigamiController
left join order_items on order_items.order_id = orders.id")
.where("orders.order_type=? and dining_facilities.is_active=?","dine_in",true)
.group("orders.id")
end
def show
@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=?",params[:order_id])
respond_to do |format|
format.html
format.json{
render :json => @order_details.to_json
}
end
.where("order_items.order_id=?",params[:order_id])
# render :json => @order_details.to_json
str = []
@order_details.each do |ord_detail|
str.push(ord_detail)
end
render :json => str.to_json
end
end