How to fetch records within a daterange in Yii2.0
my code:
$models=User::find()
->offset($offset)
->limit($limit)
// ->andFilterWhere(['<=', 'createdAt', $datefilter['to']])
// ->andFilterWhere(['>=', ['createdAt'=>$datefilter['from'] ]])
->andFilterWhere(['like', 'id', $filter['id']])
->andFilterWhere(['like', 'name', $filter['name']])
->andFilterWhere(['like', 'age', $filter['age']])
->orderBy($sort)
->all();