sql query expert needed

Job ID: 33787465

Budget: $10 – $30 USD

i have a website where we add offers from many hotels for only a country
I have to fix the search result page because
First thing is order by price (create array and order by price)
Second and most important thing is to show all the offers because i have problem when 1 offer start between 2 periods.
When we add the offers in the database we ass rows like this:
From 2022-04-24 to 2022-05-02: 350 € 7 nights
From 2022-05-02 to 2022-06-16: 420 € 7 nights
In this case if someone will search from 02 may till 09 may we have not problem
If someone search from 01 may to 08 may we have problem because we not show the offer of this hotel because the first offer finish on 2 may and the second start on the same day.
The correct way is to take 1 nigh from the first offer (50 €) and 6 nights from second offer (60*6) and we have to show 410 €.
This is in case of 7 nights, but we also add for the same period offer for 1 night, 2 nights, 3 nights, 5 nights, etc, but the way is always the same we have to show all prices.