pzct/app/controller/About.php

33 lines
1.3 KiB
PHP
Executable File

<?php
namespace app\controller;
use app\model\{Article as MArticle, Category, Block, Message, Article, Slide};
use Exception;
use think\exception\ValidateException;
use think\facade\View;
use app\service\Tool;
class About extends Base
{
public function index()
{
$category = Category::getAbout();
$categoryId = $category['id'] ?? 0;
$blocks = Block::getByCategoryId($categoryId);
$companyList = Article::where('category_id', Category::CATEGORY_COMPANY_LIST)->order('sort', 'desc')->column('id,title,content');
$leaderList = Article::where('category_id', Category::CATEGORY_COMPANY_LEADER)->order('sort', 'desc')->column('id,title,src');
$honorList = Article::where('category_id', Category::CATEGORY_COMPANY_HONOR)->order('sort', 'desc')->column('id,title,src,summary');
$this->data['categoryId'] = $categoryId;
$this->data['blocks'] = Block::convertValue($blocks);
$this->data['category'] = $category;
$this->data['companyList'] = $companyList;
$this->data['leaderList'] = $leaderList;
$this->data['honorList'] = $honorList;
$this->setSeo($category['title'].'|'.$this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
return $this->view();
}
}