YII2 многослойный и везде
$query->andFilterWhere([
'or',
['like', 'ap.fiscal_name', $this->relatedName],
['like', 'ad.fiscal_name', $this->relatedName],
]);
Panicky Panther