public function actionView($id)
{
$model = Export::model()->findByPk($id);
if (false === $model) {
throw new CHttpException(404);
}
$criteria = new CDbCriteria();
$criteria->compare('t.status', Product::STATUS_ACTIVE);
if (!empty($model->categories)) {
$criteria->addInCondition('t.category_id', (array) $model->categories);
}
if (!empty($model->brands)) {
$criteria->addInCondition('t.producer_id', (array) $model->brands);
}
$dataProvider = new CActiveDataProvider('Product', ['criteria' => $criteria]);
$offers = new CDataProviderIterator($dataProvider, 100);
ContentType::setHeader(ContentType::TYPE_XML);
$this->renderPartial('view', ['model' => $model, 'currencies' => Yii::app()->getModule('store')->getCurrencyList(), 'categories' => StoreCategory::model()->published()->findAll(), 'offers' => $offers]);
}