SELECT SQL_CALC_FOUND_ROWS neh_posts.*, 1 rooms_available, 0 rooms_booked , IFNULL((SELECT price_meta2.meta_value + 0 FROM neh_postmeta price_meta2 WHERE price_meta2.post_id=neh_posts.ID AND price_meta2.meta_key='_accommodation_min_price:2025-12-05:2027-12-05' LIMIT 1), 0) accommodation_price , IFNULL((SELECT price_meta3.meta_value + 0 FROM neh_postmeta price_meta3 WHERE price_meta3.post_id=neh_posts.ID AND price_meta3.meta_key='accommodation_static_from_price' LIMIT 1), 0) accommodation_static_price
FROM neh_posts
WHERE 1=1 AND neh_posts.post_type = 'accommodation' AND ((neh_posts.post_status = 'publish'))
GROUP BY neh_posts.ID HAVING 1=1
ORDER BY neh_posts.post_title DESC
LIMIT 0, 8
SELECT SQL_CALC_FOUND_ROWS neh_posts.*, (
SELECT SUM(rooms_available) rooms_available FROM (SELECT IFNULL(SUM(room_count), 0) rooms_available, availabilities.accommodation_id FROM neh_byt_accommodation_vacancies availabilities INNER JOIN (
select d.the_date from
(
select adddate('2025-12-05',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2025-12-05' and '2027-12-05'
ORDER BY the_date
) d
where DATE(d.the_date) >= DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON (possible_dates.the_date >= DATE(availabilities.start_date) AND possible_dates.the_date < DATE(availabilities.end_date)) WHERE 1=1 AND ('2025-12-05' BETWEEN start_date AND end_date OR start_date <= '2027-12-05') AND end_date >= '2025-12-05' GROUP BY possible_dates.the_date, availabilities.accommodation_id ) as ra WHERE accommodation_id = neh_posts.ID ) rooms_available , (
SELECT IFNULL(SUM(rooms_booked), 0) rooms_booked FROM ((SELECT IFNULL(SUM(bookings.room_count), 0) rooms_booked, bookings.accommodation_id, possible_dates.the_date FROM neh_byt_accommodation_bookings bookings INNER JOIN (
select d.the_date from
(
select adddate('2025-12-05',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2025-12-05' and '2027-12-05'
ORDER BY the_date
) d
where DATE(d.the_date) >= DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON (possible_dates.the_date >= DATE(bookings.date_from) AND possible_dates.the_date < DATE(bookings.date_to)) AND IFNULL(woo_status, '') IN ('processing') WHERE 1=1 GROUP BY possible_dates.the_date, accommodation_id ) as rb, (SELECT MIN(start_date) min_start_date, MAX(end_date) max_end_date, accommodation_id FROM neh_byt_accommodation_vacancies GROUP BY accommodation_id) min_max_available_dates ) WHERE rb.accommodation_id = neh_posts.ID AND min_max_available_dates.accommodation_id = neh_posts.ID AND rb.the_date >= min_max_available_dates.min_start_date AND rb.the_date < min_max_available_dates.max_end_date ) rooms_booked , IFNULL((SELECT price_meta2.meta_value + 0 FROM neh_postmeta price_meta2 WHERE price_meta2.post_id=neh_posts.ID AND price_meta2.meta_key='_accommodation_min_price:2025-12-05:2027-12-05' LIMIT 1), 0) accommodation_price , IFNULL((SELECT price_meta3.meta_value + 0 FROM neh_postmeta price_meta3 WHERE price_meta3.post_id=neh_posts.ID AND price_meta3.meta_key='accommodation_static_from_price' LIMIT 1), 0) accommodation_static_price
FROM neh_posts
WHERE 1=1 AND neh_posts.post_type = 'accommodation' AND ((neh_posts.post_status = 'publish'))
GROUP BY neh_posts.ID HAVING 1=1 AND rooms_available > rooms_booked AND rooms_available >= 1
ORDER BY accommodation_price ASC
LIMIT 0, 12
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.