Page.php 808 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\api\controller;
  10. use app\api\model\WxappPage;
  11. /**
  12. * 页面控制器
  13. * Class Index
  14. * @package app\api\controller
  15. */
  16. class Page extends Controller
  17. {
  18. /**
  19. * 页面数据
  20. * @param null $page_id
  21. * @return array
  22. * @throws \app\common\exception\BaseException
  23. * @throws \think\Exception
  24. * @throws \think\db\exception\DataNotFoundException
  25. * @throws \think\db\exception\ModelNotFoundException
  26. * @throws \think\exception\DbException
  27. */
  28. public function index($page_id = null)
  29. {
  30. // 页面元素
  31. $data = WxappPage::getPageData($this->getUser(false), $page_id);
  32. return $this->renderSuccess($data);
  33. }
  34. }