...
|
...
|
@@ -76,8 +76,10 @@ class Article extends Api |
|
|
public function getArticleList()
|
|
|
{
|
|
|
$myId = $this->auth->id;
|
|
|
$myId = 25;
|
|
|
|
|
|
$universityId = $this->request->param('university_id', 0, 'int');
|
|
|
$universityId = 892;
|
|
|
|
|
|
$collegeId = $this->request->param('college_id', 0, 'int');
|
|
|
|
...
|
...
|
@@ -97,22 +99,18 @@ class Article extends Api |
|
|
$type = bcadd($studentInfo['vip_level'], 1, 0);
|
|
|
$schoolIds = [];
|
|
|
// 获取学长
|
|
|
if($type = 1) {
|
|
|
if($type == 1) {
|
|
|
$schoolIds = [$studentInfo['school_id']];
|
|
|
} elseif ($type = 2) {
|
|
|
} elseif ($type == 2) {
|
|
|
$school = new School();
|
|
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
|
|
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
|
|
|
} elseif ($type = 3) {
|
|
|
} elseif ($type == 3) {
|
|
|
$school = new School();
|
|
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
|
|
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
|
|
|
}
|
|
|
|
|
|
if($schoolIds) {
|
|
|
$where['b.school_id'] = ['in', $schoolIds];
|
|
|
}
|
|
|
|
|
|
if($universityId) {
|
|
|
$where['b.university_id'] = ['=', $universityId];
|
|
|
}
|
...
|
...
|
@@ -129,9 +127,11 @@ class Article extends Api |
|
|
$where['a.user_id'] = ['=', $userId];
|
|
|
}
|
|
|
|
|
|
$where['a.deletetime'] = null;
|
|
|
|
|
|
// 获取文章
|
|
|
$article = new ArticleModel();
|
|
|
$articleList = $article->listByWhere($where, $page, $size, $studentInfo['school_id']);
|
|
|
$articleList = $article->listByWhere($where, $page, $size, $schoolIds);
|
|
|
if(!$articleList) {
|
|
|
$this->success('获取大学或学院的文章成功', $articleList);
|
|
|
}
|
...
|
...
|
|