Answer the question
In order to leave comments, you need to log in
How to display records that have expired 2 weeks?
I have such a problem, in that I can’t figure out how to display records that have already passed 2 weeks in modelSearch.
I tried something like this But
$query = Custom::find()->indexBy('id')->with('idUser');
$query->andWhere(['<', 'date', date('Y-m-d H:i:s', strtotime($this->date)+3600*24*14)])
->andWhere(['action' => Custom::CUSTOM_BROUGHT]);
Answer the question
In order to leave comments, you need to log in
as far as I understand your problem is that you do not know how to form a date that was two weeks ago, if so then it is worth replacing
on thedate('Y-d-m H:i:s', strtotime('- 2 week'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question