Answer the question
In order to leave comments, you need to log in
Am I filtering by date correctly?
Good afternoon!
It is necessary in Yii2 to display records for which the publication date ends later than today's date.
I did it in the controller like this:
$posts = $query->where(['>', 'date_end', date('Y-m-d')])
->offset($pagination->offset)
->limit($pagination->limit)
->all();
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