L
L
lzy2020-11-10 21:01:38
Yii
lzy, 2020-11-10 21:01:38

How to query by date?

Hello! Such a question, there are 2 tables:

1 - events there are ordinary fields
- Name
- Age restrictions
- Category

2 - a table of programs, well, that is, some kind of event can take place on 8-9-10 - 11 -13 -15 November
- date
- ticket price
All this logic is already done.

The question is, I now want to pull out all past events, i.e. where each date is less than today.

Now when I write a request

$query->where(['<=', 'timetableevents.date', $today]);

then in any case, an event is displayed even which has not yet ended as a whole.

How to make a request so that when all dates end, only then show in the archive?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question