'iutbay\yii2imagecache\ThumbAction', ]; } public function actionIndex() { // $catalogs = Catalog::find()->where(['parent_id'=>'0'])->all(); $modelText = Page::find()->where(['translit'=>'home'])->one(); // $news = News::find()->orderBy('id DESC')->limit(4)->all(); // $products_new = Products::find()->where(['new'=>'1'])->orderBy('id DESC')->innerJoinWith(['cost'])->groupBy('id')->limit(4)->all(); // //print_r($products_new); // $products_top = Products::find()->where(['top'=>'1'])->orderBy('id DESC')->innerJoinWith(['cost'])->groupBy('id')->limit(4)->all(); // //print_r($products_top); // //$products_sale = Products::find()->where(['sale'=>'1'])->innerJoinWith(['cost'])->orderBy('id DESC')->limit(4)->all(); // $products_akciya = Products::find()->where(['akciya'=>'1'])->innerJoinWith(['cost'])->orderBy('id DESC')->limit(4)->all(); return $this->render('index', [ 'text'=>$modelText, // 'catalogs'=>$catalogs, // 'news'=>$news, // 'products_new'=>$products_new, // 'products_top'=>$products_top, // 'products_akciya'=>$products_akciya, ]); } public function actionError(){ return $this->render('error', [ 'code'=>Yii::$app->errorHandler->exception->statusCode, 'message'=>Yii::$app->errorHandler->exception->getMessage(), ]); } public function actionPriceparam () { if (! $catalog = Category::find () ->where (['translit' => $_GET['translit']]) ->with ('parent') ->one () ) { throw new HttpException(404, 'Данной странице не существует!'); } //var_dump();die; $products = Products::find ()->where (['catalog_id' => $catalog->id])->all(); if (isset($_GET['count'])){ print (count($products));die; } //var_dump($products);die(); set_time_limit (0); header ("Content-Type: text/xml"); print ''; print ""; print "" . date ("Y-m-d h:m") . ""; print "Rukzachok"; print ""; print ""; print ""; print ""; print "" . $catalog->id . ""; print ""; print "" . $catalog->name . ""; print ""; print ""; print ""; foreach ($products as $product) { $color = Mod::find()->where (' (onstock_status_id > 0 OR is_always_active > 0) AND cost > 0 AND status = 1 ')->where(['product_id' => $product->id])->all(); $brend = Brends::find()->where(['id' => $product->brend_id])->one(); //$brends = Brends::find()->orderBy('sort ASC')->all(); //var_dump($brend);die; foreach($color as $v) { $col = $v['color']; $pr = $v['cost']; $old_pr = $v['old_cost']; print ""; print "" . htmlspecialchars ($v['id']) . ""; print "" . htmlspecialchars ($product->catalog_id) . ""; print "".$brend['name'].""; print "" . htmlspecialchars ($v['art']) . ""; print "" . htmlspecialchars (substr($catalog->name, 0,-2)) ." "; print "" . htmlspecialchars ($product->name) ." "; print "". $col . " "; print "" . htmlspecialchars ($product->body_ru) . ""; print "http://rukzachok.com.ua/products/" . htmlspecialchars ($_GET['translit']) . "/" . htmlspecialchars ($product->translit). ""; print "http://rukzachok.com.ua/upload/mod/big/" . $v['image'] . ""; print "" . $pr . ""; print "" . $old_pr . ""; print ""; print "В наличии"; print ""; print ""; } } print ""; print ""; } public function actionPrice() { if (! $catalog = Category::find () ->where (['translit' => $_GET['translit']]) ->with ('parent') ->one () ) { throw new HttpException(404, 'Данной странице не существует!'); } $products = Products::find ()->where (['catalog_id' => $catalog->id])->all(); if (isset($_GET['count'])){ print (count($products));die; } //var_dump($products);die(); set_time_limit (0); header ("Content-Type: text/xml"); print ''; print ""; print "" . date ("Y-m-d h:m") . ""; print "Rukzachok"; print ""; print ""; print ""; print ""; print "" . $catalog->id . ""; print ""; print "" . $catalog->name . ""; print ""; print ""; print ""; foreach ($products as $product) { $color = Mod::find()->where (' (onstock_status_id > 0 OR is_always_active > 0) AND cost > 0 AND status = 1 ')->where(['product_id' => $product->id])->all(); $brend = Brends::find()->where(['id' => $product->brend_id])->one(); //$brends = Brends::find()->orderBy('sort ASC')->all(); //var_dump($brend);die; foreach($color as $v) { $col = $v['color']; $pr = $v['cost']; $old_pr = $v['old_cost']; print ""; print "" . htmlspecialchars ($v['id']) . ""; print "" . htmlspecialchars ($product->catalog_id) . ""; print "".$brend['name'].""; print "" . htmlspecialchars ($v['art']) . ""; print "" . htmlspecialchars ($product->name) ." ". $col . " "; print "" . htmlspecialchars ($product->body_ru) . ""; print "http://rukzachok.com.ua/products/" . htmlspecialchars ($_GET['translit']) . "/" . htmlspecialchars ($product->translit) . ""; print "http://rukzachok.com.ua/upload/mod/big/" . $v['image'] . ""; print "" . $pr . ""; print "" . $old_pr . ""; print ""; print "В наличии"; print ""; print ""; } } print ""; print ""; } }