Answer the question
In order to leave comments, you need to log in
How to select movies for a specified day?
There is such a datepicker on the site, in which the user must select a date and films of this date should be displayed to him (this is already a solved task):
Base: There is a table films in which there are two fields start_date and end_date . One movie can run from the 21st to the 28th and another can run from the 24th to the 29th. So, on the 28th there will be two movies and on the 29th, 22nd, 21st one, etc.
And for every day at the same time, it has a scheduled time, the time_film table with the id | start | end | price | films_id .
Relationship between films and time_film = OneToMany .
Need ideas on how best to solve this problem. I have ideas in my head like:
$timing_films = Film::where([
['status', 0],
['end_date', '>=', date('m/d/Y')]
])->get();
// достаем все фильмы которые будут играть
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question