| 
									
										
										
										
											2020-11-25 09:07:06 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | namespace app\controller; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-01 09:30:15 +08:00
										 |  |  | use app\model\{Category, Block, Article, Slide}; | 
					
						
							| 
									
										
										
										
											2020-11-25 09:07:06 +08: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 18:48:29 +08:00
										 |  |  |         $blocks = Block::getByCategoryId($categoryId); | 
					
						
							|  |  |  |         $blocks = Block::analysisBlock($blocks); | 
					
						
							|  |  |  |         $this->data['blocks'] = $blocks; | 
					
						
							| 
									
										
										
										
											2020-12-01 09:30:15 +08:00
										 |  |  |         // 轮播图
 | 
					
						
							|  |  |  |         $this->data['slides'] = Slide::getList(); | 
					
						
							| 
									
										
										
										
											2020-11-25 18:48:29 +08:00
										 |  |  |         // 网络营销栏目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 09:07:06 +08:00
										 |  |  |         return $this->view(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |