When I try to run the query mentioned below, I get this error - strtoupper() expects parameter 1 to be string, array given (/vendor/yiisoft/yii2/db/QueryBuilder.php - Line 1050)
$bookings = \app\models\Bookings::find()
->where([
'AND',
['IN', 'member_id', $members_query],
['IN', 'resource_id', $resources_query],
['>=', 'from_date', $start_date],
['<=', 'to_date', $end_date]
])->all();
$member_query
and $resources_query
are ActiveQuery objects. I also tried the variation below but ended up with same error.
$bookings = \app\models\Bookings::find()
->where(['IN', 'member_id', $members_query]),
->andWhere(['IN', 'resource_id', $resources_query]),
->andWhere(['>=', 'from_date', $start_date]),
->andWhere(['<=', 'to_date', $end_date])
->all();