正在显示
1 个修改的文件
包含
8 行增加
和
7 行删除
@@ -82,23 +82,25 @@ class Student extends Api | @@ -82,23 +82,25 @@ class Student extends Api | ||
82 | 82 | ||
83 | $page = $this->request->param('page', 1, 'int'); | 83 | $page = $this->request->param('page', 1, 'int'); |
84 | $size = $this->request->param('size', 10, 'int'); | 84 | $size = $this->request->param('size', 10, 'int'); |
85 | - $type = $this->request->param('type', 1, 'int'); | 85 | + $type = $this->request->param('type', 0, 'int'); |
86 | $universityId = $this->request->param('university_id', 0, 'int'); | 86 | $universityId = $this->request->param('university_id', 0, 'int'); |
87 | $graduatedId = $this->request->param('graduated_id', 0, 'int'); | 87 | $graduatedId = $this->request->param('graduated_id', 0, 'int'); |
88 | $upId = $this->request->param('up_id', 0, 'int'); | 88 | $upId = $this->request->param('up_id', 0, 'int'); |
89 | 89 | ||
90 | $where['show_switch'] = ['=', 1]; | 90 | $where['show_switch'] = ['=', 1]; |
91 | $student = new StudentModel(); | 91 | $student = new StudentModel(); |
92 | + // 获取学校 | ||
93 | + $studentInfo = $student->infoByUserIdCanShow($userId); | ||
94 | + if(!$studentInfo) { | ||
95 | + $this->error('您的提交有误'); | ||
96 | + } | ||
92 | 97 | ||
93 | if($type) { // 学校限制 | 98 | if($type) { // 学校限制 |
94 | if(!in_array($type, [1, 2, 3])) { | 99 | if(!in_array($type, [1, 2, 3])) { |
95 | $this->error('您的提交有误'); | 100 | $this->error('您的提交有误'); |
96 | } | 101 | } |
97 | - | ||
98 | - // 获取学校 | ||
99 | - $studentInfo = $student->infoByUserIdCanShow($userId); | ||
100 | - if(!$studentInfo) { | ||
101 | - $this->error('您的提交有误'); | 102 | + } else { |
103 | + $type = bcadd($studentInfo['vip_level'], 1, 0); | ||
102 | } | 104 | } |
103 | 105 | ||
104 | $schoolIds = []; | 106 | $schoolIds = []; |
@@ -124,7 +126,6 @@ class Student extends Api | @@ -124,7 +126,6 @@ class Student extends Api | ||
124 | if($schoolIds) { | 126 | if($schoolIds) { |
125 | $where['school_id'] = ['in', $schoolIds]; | 127 | $where['school_id'] = ['in', $schoolIds]; |
126 | } | 128 | } |
127 | - } | ||
128 | 129 | ||
129 | if($universityId) { | 130 | if($universityId) { |
130 | $where['university_id'] = ['=', $universityId]; | 131 | $where['university_id'] = ['=', $universityId]; |
-
请 注册 或 登录 后发表评论