Index.php 703 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\home\controller;
  3. /**
  4. * 前端首页控制器
  5. */
  6. class Index extends IndexBase
  7. {
  8. // 首页
  9. public function index()
  10. {
  11. return $this->fetch('reg');
  12. }
  13. // 详情
  14. public function details($id = 0)
  15. {
  16. $where = [];
  17. !empty((int)$id) && $where['a.id'] = $id;
  18. $data = $this->logicArticle->getArticleInfo($where);
  19. $this->assign('article_info', $data);
  20. $this->assign('category_list', $this->logicArticle->getArticleCategoryList([], true, 'create_time asc', false));
  21. return $this->fetch('details');
  22. }
  23. }