当我尝试运行下面提到的查询时,我收到此错误 - 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
和$resources_query
是ActiveQuery对象。我也尝试了下面的变化,但最终出现了同样的错误。
$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();