bind(Paginator::class, Layui::class); $categoryId = $this->request->param("category_id"); $category = Category::getById($this->request->param("category_id")); if ($category) { //$description = $category['description'] ? $category['description'] : $this->system['seo_description']; $description = $category['description'] ? $category['description'] : $category['title']; $keywords = $category['seo_keywords'] ? $category['seo_keywords'] : $category['title']; //$this->setSeo($category['title'], $this->system['seo_keywords'], $description); $this->setSeo($category['title'] . "-" . $this->system['company_name'], $keywords, $description); } else { return $this->error('错误页面'); } $childCategory = Category::getChildrenByParentId($categoryId); $this->data['categoryId'] = $categoryId; $this->data['category'] = $category; $this->data['childCategory'] = $childCategory; $this->data['blocks'] = Block::getByCategoryId($categoryId); return $this->view($category['template_detail']); } }