Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select a.property_id,count(a.booking_id) as total_bookings,
- group_concat(concat(date_format(a.check_in,'%m/%d/%Y'),' To ',
- date_format(a.check_out,'%m/%d/%Y'),' ','(',(case a.book_status when 1 then 'Pending' when 3 then 'Confirm' end) ,')',' |
- <a href='manage_booking.php?action=ed&id=',a.booking_id,'' target=_blank class=linkun >
- View Detail</a>','<br>')) as dates FROM apl_property_booking AS a WHERE EXISTS (
- SELECT booking_id FROM apl_property_booking AS b WHERE b.booking_id != a.booking_id and
- b.property_id=a.property_id AND (b.check_in < a.check_out AND a.check_in < b.check_out)
- and b.book_status in (1,3) and ('2015-04-01' <= date_add( b.check_out, INTERVAL -1 DAY )
- AND '2015-04-27' >= date_add( b.check_in, INTERVAL +1 DAY )) ) and a.book_status in (1,3)
- and ('2015-04-01' <= date_add( a.check_out, INTERVAL -1 DAY ) AND
- '2015-04-27' >= date_add( a.check_in, INTERVAL +1 DAY )) group by a.property_id
- order by a.check_in desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement