2020-11-25 01:07:06 +00:00
|
|
|
<?php
|
|
|
|
namespace app\controller;
|
|
|
|
|
2020-12-01 01:30:15 +00:00
|
|
|
use app\model\{Category, Block, Article, Slide};
|
2020-11-25 01:07:06 +00:00
|
|
|
|
|
|
|
class Index extends Base
|
|
|
|
{
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$category = Category::getIndex();
|
|
|
|
$categoryId = $category['id'] ?? 0;
|
|
|
|
$this->data['categoryId'] = $categoryId;
|
|
|
|
$this->setSeo($this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
|
2020-11-25 10:48:29 +00:00
|
|
|
$blocks = Block::getByCategoryId($categoryId);
|
|
|
|
$blocks = Block::analysisBlock($blocks);
|
|
|
|
$this->data['blocks'] = $blocks;
|
2020-12-01 01:30:15 +00:00
|
|
|
// 轮播图
|
|
|
|
$this->data['slides'] = Slide::getList();
|
2020-11-25 10:48:29 +00:00
|
|
|
// 网络营销栏目ID
|
2020-12-03 05:47:57 +00:00
|
|
|
$this->data['marketingCId'] = Category::$CIdList['marketing'];
|
2020-11-25 10:48:29 +00:00
|
|
|
// 关联产品中心
|
|
|
|
$this->data['products'] = Article::getLatestByCategory(Category::$CIdList['products'], 4);;
|
|
|
|
// 关联企业新闻
|
2020-12-03 05:47:57 +00:00
|
|
|
$this->data['newsEnterprises'] = Article::getLatestByCategory(Category::$CIdList['news_children']['enterprise'], 4);
|
2020-11-25 10:48:29 +00:00
|
|
|
// 关联行业资讯
|
2020-12-03 05:47:57 +00:00
|
|
|
$this->data['newsIndustries'] = Article::getLatestByCategory(Category::$CIdList['news_children']['industry'], 4);;
|
2020-11-25 01:07:06 +00:00
|
|
|
return $this->view();
|
|
|
|
}
|
|
|
|
}
|