diff --git a/console/controllers/SiteMapController.php b/console/controllers/SiteMapController.php index 2902964..cba7d3f 100644 --- a/console/controllers/SiteMapController.php +++ b/console/controllers/SiteMapController.php @@ -180,50 +180,54 @@ class SiteMapController extends Controller foreach($this->getCategories() as $category) { foreach ($this->getBrands($category) as $brand) { if($this->checkFilter($category, ['brands' => [$brand->brand_id]])){ - $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias]]]) ; + $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias]]]); $this->createRow($url , 0.8, $content); } } - } - - //filters 1 lvl - foreach($this->getCategories() as $category) { - foreach ($this->getFilters($category) as $filter) { - if($this->checkFilter($category, [$filter['group_alias'] => [$filter['option_alias']]])){ - $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter['group_alias'] => [$filter['option_alias']]] ]); - $this->createRow($url , 0.8, $content); - } - + foreach ($this->getBrands($category) as $brand) { + $url = Url::to(['catalog/brand', 'brand' => $brand]); + $this->createRow($url, 0.8, $content); } } - //seo links - foreach($this->getSeoLinks() as $link) { - $url = Yii::$app->urlManager->baseUrl.$link->url; - $this->createRow($url , 0.7, $content); - - } - - //filters 2 lvl - foreach($this->getCategories() as $category) { - foreach ($this->getFilters($category) as $filter1) { - foreach ($this->getFilters($category) as $filter2) { - if($this->checkFilter($category, [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] )){ - $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] ]); - $this->createRow($url , 0.7, $content); - } - - } - - foreach ($this->getBrands($category) as $brand) { - if($this->checkFilter($category, ['brands' => [$brand->brand_id], $filter1['group_alias'] => [$filter1['option_alias']]] )){ - $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias],$filter1['group_alias'] => [$filter1['option_alias']]]]); - $this->createRow($url , 0.7,$content); - } - - } - } - } + //filters 1 lvl +// foreach($this->getCategories() as $category) { +// foreach ($this->getFilters($category) as $filter) { +// if($this->checkFilter($category, [$filter['group_alias'] => [$filter['option_alias']]])){ +// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter['group_alias'] => [$filter['option_alias']]] ]); +// $this->createRow($url , 0.8, $content); +// } +// +// } +// } +// +// //seo links +// foreach($this->getSeoLinks() as $link) { +// $url = Yii::$app->urlManager->baseUrl.$link->url; +// $this->createRow($url , 0.7, $content); +// +// } +// +// //filters 2 lvl +// foreach($this->getCategories() as $category) { +// foreach ($this->getFilters($category) as $filter1) { +// foreach ($this->getFilters($category) as $filter2) { +// if($this->checkFilter($category, [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] )){ +// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => [$filter1['group_alias'] => [$filter1['option_alias']],$filter2['group_alias'] => [$filter2['option_alias']]] ]); +// $this->createRow($url , 0.7, $content); +// } +// +// } +// +// foreach ($this->getBrands($category) as $brand) { +// if($this->checkFilter($category, ['brands' => [$brand->brand_id], $filter1['group_alias'] => [$filter1['option_alias']]] )){ +// $url = Url::to(['catalog/category', 'category' => $category, 'filters' => ['brands' => [$brand->alias],$filter1['group_alias'] => [$filter1['option_alias']]]]); +// $this->createRow($url , 0.7,$content); +// } +// +// } +// } +// } -- libgit2 0.21.4