2020-11-25 01:07:06 +00:00
|
|
|
<?php
|
|
|
|
namespace app\controller;
|
|
|
|
|
2020-11-25 10:48:29 +00:00
|
|
|
use app\model\{Category, Block, Article};
|
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;
|
|
|
|
// 网络营销栏目ID
|
|
|
|
$this->data['marketingCId'] = Category::$CIdList['marketing_network'];
|
|
|
|
// 关联产品中心
|
|
|
|
$this->data['products'] = Article::getLatestByCategory(Category::$CIdList['products'], 4);;
|
|
|
|
// 关联企业新闻
|
|
|
|
$this->data['newsEnterprises'] = Article::getLatestByCategory(Category::$CIdList['news_enterprise'], 4);
|
|
|
|
// 关联行业资讯
|
|
|
|
$this->data['newsIndustries'] = Article::getLatestByCategory(Category::$CIdList['news_industry'], 4);;
|
2020-11-25 01:07:06 +00:00
|
|
|
return $this->view();
|
|
|
|
}
|
|
|
|
}
|