Page.php 699 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\WxappPage;
  4. /**
  5. * 页面控制器
  6. * Class Index
  7. * @package app\api\controller
  8. */
  9. class Page extends Controller
  10. {
  11. /**
  12. * 页面数据
  13. * @param null $page_id
  14. * @return array
  15. * @throws \app\common\exception\BaseException
  16. * @throws \think\Exception
  17. * @throws \think\db\exception\DataNotFoundException
  18. * @throws \think\db\exception\ModelNotFoundException
  19. * @throws \think\exception\DbException
  20. */
  21. public function index($page_id = null)
  22. {
  23. // 页面元素
  24. $data = WxappPage::getPageData($this->getUser(false), $page_id);
  25. return $this->renderSuccess($data);
  26. }
  27. }