multiple sale and order
This commit is contained in:
@@ -18,6 +18,17 @@ class DiningFacility < ApplicationRecord
|
||||
self.save
|
||||
end
|
||||
|
||||
def get_booking
|
||||
booking = self.get_current_booking
|
||||
if booking
|
||||
if booking.dining_facility_id.to_i == self.id
|
||||
if booking.booking_status == 'assign'
|
||||
return booking
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_current_booking
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user