fix error

This commit is contained in:
chiu 2020-05-25 12:09:19 +08:00
parent 02f46d90e2
commit d159171993
1 changed files with 6 additions and 3 deletions

View File

@ -105,6 +105,9 @@ class Property
stime_tp = stime
etime_tp = etime
b_interval = booking.recurring_interval
if (b_interval == 'month' || b_interval == 'week') && booking.recurring_end_date.nil?
b_interval = nil
end
if b_interval == 'month'
b_sdata = booking.start_time.day*10000 + booking.start_time.hour*100 + booking.start_time.minute
b_edata = booking.end_time.day*10000 + booking.end_time.hour*100 + booking.end_time.minute
@ -126,8 +129,8 @@ class Property
sdata = stime_tp
edata = etime_tp
end
if (sdata <= b_sdata && edata >= b_sdata) || (sdata >= b_sdata && edata <= b_edata) || (sdata <= b_edata && edata >= b_edata)
if etime_tp > booking.start_time
if (sdata <= b_sdata && edata >= b_sdata) || (sdata >= b_sdata && edata <= b_edata) || (sdata <= b_edata && edata >= b_edata)
available = false
end
end