作者 谢百川

修改学长列表

... ... @@ -82,48 +82,49 @@ class Student extends Api
$page = $this->request->param('page', 1, 'int');
$size = $this->request->param('size', 10, 'int');
$type = $this->request->param('type', 1, 'int');
$type = $this->request->param('type', 0, 'int');
$universityId = $this->request->param('university_id', 0, 'int');
$graduatedId = $this->request->param('graduated_id', 0, 'int');
$upId = $this->request->param('up_id', 0, 'int');
$where['show_switch'] = ['=', 1];
$student = new StudentModel();
// 获取学校
$studentInfo = $student->infoByUserIdCanShow($userId);
if(!$studentInfo) {
$this->error('您的提交有误');
}
if($type) { // 学校限制
if(!in_array($type, [1, 2, 3])) {
$this->error('您的提交有误');
}
} else {
$type = bcadd($studentInfo['vip_level'], 1, 0);
}
// 获取学校
$studentInfo = $student->infoByUserIdCanShow($userId);
if(!$studentInfo) {
$this->error('您的提交有误');
$schoolIds = [];
// 获取学长
if($type == 1) {
$schoolIds = [$studentInfo['school_id']];
} elseif ($type == 2) {
if(bcadd($studentInfo['vip_level'], 1, 0) < $type) {
$this->error('需要买市卡');
}
$schoolIds = [];
// 获取学长
if($type == 1) {
$schoolIds = [$studentInfo['school_id']];
} elseif ($type == 2) {
if(bcadd($studentInfo['vip_level'], 1, 0) < $type) {
$this->error('需要买市卡');
}
$school = new School();
$schoolInfo = $school->infoById($studentInfo['school_id']);
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
} elseif ($type == 3) {
if(bcadd($studentInfo['vip_level'], 1, 0) < $type) {
$this->error('需要买省卡');
}
$school = new School();
$schoolInfo = $school->infoById($studentInfo['school_id']);
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
$school = new School();
$schoolInfo = $school->infoById($studentInfo['school_id']);
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
} elseif ($type == 3) {
if(bcadd($studentInfo['vip_level'], 1, 0) < $type) {
$this->error('需要买省卡');
}
$school = new School();
$schoolInfo = $school->infoById($studentInfo['school_id']);
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
}
if($schoolIds) {
$where['school_id'] = ['in', $schoolIds];
}
if($schoolIds) {
$where['school_id'] = ['in', $schoolIds];
}
if($universityId) {
... ...