Объединение запросов
$query1 = (new \yii\db\Query())
->select("id, category_id AS type, name")
->from('post')
->limit(10);
$query2 = (new \yii\db\Query())
->select('id, type, name')
->from('user')
->limit(10);
$query1->union($query2);
Yii Справочник v0.05 © 2007-2024 Igor Salnikov aka SunDoctor