| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\api\controller;
- use app\api\model\School;
- use app\api\model\SchoolSpeciality as SchoolSpecialityModel;
- use think\response\Json;
- /**
- * 学校专业控制器
- * Class SchoolSpeciality
- * @package app\api\controller
- */
- class SchoolSpeciality extends Controller
- {
- /**
- * 学校列表
- * @return \think\response\Json
- * @throws \think\db\exception\DbException
- */
- public function list()
- {
- // 获取列表数据
- $model = new SchoolSpecialityModel;
- $pageSize = $this->request->param('pageSize', 12);
- $list = $model->getList($this->request->param(), $pageSize);
- return $this->renderSuccess(compact('list'));
- }
- /**
- * 文章详情
- * @param int $articleId
- * @return array|\think\response\Json
- * @throws \app\common\exception\BaseException
- */
- public function detail(int $id)
- {
- $detail = SchoolSpecialityModel::getDetail($id);
- return $this->renderSuccess(compact('detail'));
- }
- public function sameList()
- {
- // 获取列表数据
- $model = new School;
- $pageSize = $this->request->param('pageSize', 12);
- $list = $model->getList($this->request->param(), $pageSize);
- return $this->renderSuccess(compact('list'));
- }
- }
|