Fix bug for last version.

This commit is contained in:
BoHung Chiu 2020-07-20 21:58:29 +08:00
parent 1e18ac077a
commit 9c8c1bd0c4
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class PHire
end
def self.recurring_event(start_date,end_date,property_id)
@recurring_events = self.where(:property_id => property_id, :recurring => true, :recurring_end_date.gte => start_date)
@recurring_events = self.where(:property_id => property_id, :recurring_end_date.gte => start_date)
@recurring = []
@recurring_events.each do |re|
case re.recurring_interval

View File

@ -100,7 +100,7 @@ class Property
available = false
end
if available
bookings = phires.where(:recurring_end_date.gte => stime, :recurring => true)
bookings = phires.where(:recurring_end_date.gte => stime, :recurring => true) + phires.where(:recurring => false,:recurring_end_date => nil) + phires.where(:recurring => false,:recurring_end_date.gte => stime)
case interval
when 'week'
d_step = 1.week