BottommenuController.php 756 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\index\controller;
  3. use think\exception\ValidateException;
  4. use app\model\BottomMenu;
  5. class BottommenuController extends Base
  6. {
  7. public function list()
  8. {
  9. $data = BottomMenu::getBottommenu($this->userInfo);
  10. return $this->json(['data' => $data]);
  11. }
  12. public function getindex()
  13. {
  14. $where['weid'] = weid();
  15. $where['is_index'] = 1;
  16. $where['tid'] = 0;
  17. $where['module'] = 'bottom';
  18. $data = BottomMenu::where($where)
  19. ->order('sort asc')
  20. ->find();
  21. if (empty($data)) {
  22. $data['url'] = '/pages/index/index';
  23. } else {
  24. $data = $data->toArray();
  25. }
  26. return $this->json(['data' => $data]);
  27. }
  28. }