baodinzhihui/app/controller/Index.php

21 lines
595 B
PHP

<?php
namespace app\controller;
use app\model\{Category, Block};
use think\facade\View;
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']);
$this->data['blocks'] = Block::getByCategoryId($categoryId);
$category = Category::getById(1);
View::assign("category",$category);
return $this->view();
}
}