control order to logout

This commit is contained in:
Yan
2017-06-29 19:09:01 +06:30
parent fd857146e8
commit dd95b29d7d
3 changed files with 31 additions and 18 deletions

View File

@@ -39,6 +39,16 @@ class DiningFacility < ApplicationRecord
end
end
def get_moved_booking
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='moved' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
if booking.count > 0 then
return booking[0]
else
return nil
end
end
def get_new_booking
# query for new
# if status

View File

@@ -54,7 +54,7 @@ class Order < ApplicationRecord
end
return false, @message = "booking fail"
return false
end