$id = '40,42,2,24,25,1';
$sql= 'select name from service where id IN (:id)';
When the IN condition ids are supplied within the query it returns all 6 rows
$rows = conn()->createCommand('select name from service where id IN (' . $id . ')')->queryAll();
When supplied as a query param this returns only the 1st row for id=40
$rows = conn()->createCommand($sql)->queryAll(true, array(':id' => $id));
how to provide the IN condition string in the queryAll params?