PageController.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 老猫 <thinkcmf@126.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\portal\controller;
  12. use app\portal\service\PostService;
  13. use cmf\controller\HomeBaseController;
  14. class PageController extends HomeBaseController {
  15. /**
  16. * 页面管理
  17. * @return mixed
  18. * @throws \think\db\exception\DataNotFoundException
  19. * @throws \think\db\exception\ModelNotFoundException
  20. * @throws \think\exception\DbException
  21. */
  22. public function index() {
  23. $postService = new PostService();
  24. $pageId = $this->request->param('id', 0, 'intval');
  25. $page = $postService->publishedPage($pageId);
  26. if (empty($page)) {
  27. abort(404, ' 页面不存在!');
  28. }
  29. $this->assign('page', $page);
  30. $more = $page['more'];
  31. $tplName = empty($more['template']) ? 'page' : $more['template'];
  32. return $this->fetch("/$tplName");
  33. }
  34. public function contact() {
  35. return $this->fetch("/contact");
  36. }
  37. public function app() {
  38. //轮播图
  39. return $this->fetch("/watercatapppage");
  40. }
  41. /**
  42. * 工人列表
  43. *
  44. * @return void
  45. * @author wj
  46. * @date 2025-09-08
  47. */
  48. public function workerlist() {
  49. return $this->fetch("/workerlist");
  50. }
  51. }