|
@@ -21,56 +21,14 @@ class Index extends FecIndex
|
|
|
public function getLastData()
|
|
|
{
|
|
|
$this->initHead();
|
|
|
- // change current layout File.
|
|
|
- //Yii::$service->page->theme->layoutFile = 'home.php';
|
|
|
- $home_floor_one = Yii::$app->controller->module->params['home_floor_one'];
|
|
|
- $home_floor_two = Yii::$app->controller->module->params['home_floor_two'];
|
|
|
- $home_floor_three = Yii::$app->controller->module->params['home_floor_three'];
|
|
|
+
|
|
|
return [
|
|
|
'bestFeaturedProducts' => $this->getFeaturedProduct(),
|
|
|
'bestSellerProducts' => $this->getBestSellerProducts(),
|
|
|
-
|
|
|
- 'featuredProducts' => $this->getHomeFeaturedProducts(),
|
|
|
- 'newProducts' => $this->getHomeNewProducts(),
|
|
|
- 'onSaleProducts' => $this->getHomeOnSaleProducts(),
|
|
|
-
|
|
|
- 'floor_one_title' => isset($home_floor_one['slider']['title']) ? $home_floor_one['slider']['title'] : '',
|
|
|
- 'floor_one_items' => isset($home_floor_one['slider']['items']) ? $home_floor_one['slider']['items'] : '',
|
|
|
- 'floor_one_products' => is_array($home_floor_one['product_skus']) ? $this->getProductBySkus($home_floor_one['product_skus']) : '',
|
|
|
- 'floor_one_banner_text' => isset($home_floor_one['banner-text']) ? $home_floor_one['banner-text'] : '',
|
|
|
-
|
|
|
- 'floor_two_title' => isset($home_floor_two['slider']['title']) ? $home_floor_two['slider']['title'] : '',
|
|
|
- 'floor_two_items' => isset($home_floor_two['slider']['items']) ? $home_floor_two['slider']['items'] : '',
|
|
|
- 'floor_two_products' => is_array($home_floor_two['product_skus']) ? $this->getProductBySkus($home_floor_two['product_skus']) : '',
|
|
|
- 'floor_two_banner_text' => isset($home_floor_two['banner-text']) ? $home_floor_two['banner-text'] : '',
|
|
|
-
|
|
|
- 'floor_three_title' => isset($home_floor_three['slider']['title']) ? $home_floor_three['slider']['title'] : '',
|
|
|
- 'floor_three_items' => isset($home_floor_three['slider']['items']) ? $home_floor_three['slider']['items'] : '',
|
|
|
- 'floor_three_products' => is_array($home_floor_three['product_skus']) ? $this->getProductBySkus($home_floor_three['product_skus']) : '',
|
|
|
- 'floor_three_banner_text' => isset($home_floor_three['banner-text']) ? $home_floor_three['banner-text'] : '',
|
|
|
-
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- public function getHomeFeaturedProducts()
|
|
|
- {
|
|
|
- $featured_skus = Yii::$app->controller->module->params['home_featured_products'];
|
|
|
|
|
|
- return $this->getProductBySkus($featured_skus);
|
|
|
+ ];
|
|
|
}
|
|
|
-
|
|
|
- public function getHomeNewProducts()
|
|
|
- {
|
|
|
- $home_new_products = Yii::$app->controller->module->params['home_new_products'];
|
|
|
|
|
|
- return $this->getProductBySkus($home_new_products);
|
|
|
- }
|
|
|
-
|
|
|
- public function getHomeOnSaleProducts()
|
|
|
- {
|
|
|
- $home_onsale_products = Yii::$app->controller->module->params['home_onsale_products'];
|
|
|
|
|
|
- return $this->getProductBySkus($home_onsale_products);
|
|
|
- }
|
|
|
|
|
|
}
|