//多个id放入数组中
$idStr = [];
foreach ($roleData as $key => $value){
$idStr[] = $value['id'];
}
$roleEatlive = RoleEatlive::find()
->where(['in','role_id',$idStr])
->asArray()->all();
加一条用array_column处理
->where(['in', 'auth_pid', array_column($pidListOne, 'auth_id')])
//也可以
->where([
'in', 'id', [1, 3, 5, 6]
])
//not in 我就不说了
->where([
'not in', 'id', [1, 2, 4, 3]
])