School.php 949 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\School as SchoolModel;
  4. /**
  5. * 学校控制器
  6. * Class School
  7. * @package app\api\controller
  8. */
  9. class School extends Controller
  10. {
  11. /**
  12. * 学校列表
  13. * @return \think\response\Json
  14. * @throws \think\db\exception\DbException
  15. */
  16. public function list()
  17. {
  18. // 获取列表数据
  19. $model = new SchoolModel();
  20. $pageSize = $this->request->param('pageSize', 15);
  21. $list = $model->getList($this->request->param(), $pageSize);
  22. return $this->renderSuccess(compact('list'));
  23. }
  24. /**
  25. * 选项列表
  26. * @return \think\response\Json
  27. * @throws \think\db\exception\DbException
  28. */
  29. public function options()
  30. {
  31. $model = new SchoolModel();
  32. $list = $model->getOptionList($this->request->param());
  33. return $this->renderSuccess(compact('list'));
  34. }
  35. }