Answer the question
In order to leave comments, you need to log in
How to correctly access the model in order to correctly pull the data through the beetween?
In general, I use DateRangePicker. On change, I send two date boundaries to the server and make a request.
if (Yii::$app->request->isAjax && Yii::$app->request->isPost)
{
$order = Yii::$app->request->post('a');
$orderdate = Orders::find()
->where(['between', 'date', $order[0], $order[1]])->all();
$cat = Category::find()->all();
$price = Price::find()->all();
return $this->asJson([$orderdate, $cat ,$price]);
}
Answer the question
In order to leave comments, you need to log in
I suspect that this is due to the fact that in the database I have the date format 2018-05-24 13:37:45 , and I send the date 2018-05-24 without time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question