| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\api\controller;
- use app\api\model\School as SchoolModel;
- /**
- * 学校控制器
- * Class School
- * @package app\api\controller
- */
- class School extends Controller
- {
- /**
- * 学校列表
- * @return \think\response\Json
- * @throws \think\db\exception\DbException
- */
- public function list()
- {
- // 获取列表数据
- $model = new SchoolModel();
- $pageSize = $this->request->param('pageSize', 15);
- $list = $model->getList($this->request->param(), $pageSize);
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 选项列表
- * @return \think\response\Json
- * @throws \think\db\exception\DbException
- */
- public function options()
- {
- $model = new SchoolModel();
- $list = $model->getOptionList($this->request->param());
- return $this->renderSuccess(compact('list'));
- }
- }
|