where(['user_id' => \Yii::$app->user->id]) ->select(['id', 'strength', 'amount', 'table_id']) ->orderBy(['created_at' => SORT_DESC]) ->with([ 'table' => function (\yii\db\ActiveQuery $query) { $query->select(['id', 'name']); }, 'products' => function (\yii\db\ActiveQuery $query) { $query->select(['id', 'taste']); }, ]) ->asArray() ->all(); } }