finished order tab view and customer tab

This commit is contained in:
Aung Myo
2017-05-31 18:19:51 +06:30
parent 8847cf8bf3
commit f036274f5e
10 changed files with 99 additions and 175 deletions

View File

@@ -1,16 +1,22 @@
class Crm::HomeController < BaseCrmController
def index
@booking = Booking.select("bookings.id as booking_id,
bookings.checkin_at,
od.customer_id as customer,
odt.id")
# @booking = Booking.all
@booking = Booking.select("bookings.id as booking_id,
bookings.checkin_at,
bookings.checkin_by,
bookings.dining_facility_id,
od.customer_id as customer,
od.item_count as count,
odt.id as order_item_id,
odt.item_name as item_name")
.joins("join booking_orders as bko ON bko.booking_id = bookings.id")
.joins("right join orders as od ON od.id = bko.order_id")
.joins("right join order_items as odt ON odt.order_id=od.id")
.order("bookings.id DESC")
.order("bookings.id DESC")
@customer = Customer.all
end
def show