|
@@ -76,8 +76,10 @@ class Article extends Api |
|
@@ -76,8 +76,10 @@ class Article extends Api |
76
|
public function getArticleList()
|
76
|
public function getArticleList()
|
77
|
{
|
77
|
{
|
78
|
$myId = $this->auth->id;
|
78
|
$myId = $this->auth->id;
|
|
|
79
|
+ $myId = 25;
|
79
|
|
80
|
|
80
|
$universityId = $this->request->param('university_id', 0, 'int');
|
81
|
$universityId = $this->request->param('university_id', 0, 'int');
|
|
|
82
|
+ $universityId = 892;
|
81
|
|
83
|
|
82
|
$collegeId = $this->request->param('college_id', 0, 'int');
|
84
|
$collegeId = $this->request->param('college_id', 0, 'int');
|
83
|
|
85
|
|
|
@@ -97,22 +99,18 @@ class Article extends Api |
|
@@ -97,22 +99,18 @@ class Article extends Api |
97
|
$type = bcadd($studentInfo['vip_level'], 1, 0);
|
99
|
$type = bcadd($studentInfo['vip_level'], 1, 0);
|
98
|
$schoolIds = [];
|
100
|
$schoolIds = [];
|
99
|
// 获取学长
|
101
|
// 获取学长
|
100
|
- if($type = 1) {
|
102
|
+ if($type == 1) {
|
101
|
$schoolIds = [$studentInfo['school_id']];
|
103
|
$schoolIds = [$studentInfo['school_id']];
|
102
|
- } elseif ($type = 2) {
|
104
|
+ } elseif ($type == 2) {
|
103
|
$school = new School();
|
105
|
$school = new School();
|
104
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
106
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
105
|
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
|
107
|
$schoolIds = $school->listByCityId($schoolInfo['city_id']);
|
106
|
- } elseif ($type = 3) {
|
108
|
+ } elseif ($type == 3) {
|
107
|
$school = new School();
|
109
|
$school = new School();
|
108
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
110
|
$schoolInfo = $school->infoById($studentInfo['school_id']);
|
109
|
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
|
111
|
$schoolIds = $school->listByProvinceId($schoolInfo['province_id']);
|
110
|
}
|
112
|
}
|
111
|
|
113
|
|
112
|
- if($schoolIds) {
|
|
|
113
|
- $where['b.school_id'] = ['in', $schoolIds];
|
|
|
114
|
- }
|
|
|
115
|
-
|
|
|
116
|
if($universityId) {
|
114
|
if($universityId) {
|
117
|
$where['b.university_id'] = ['=', $universityId];
|
115
|
$where['b.university_id'] = ['=', $universityId];
|
118
|
}
|
116
|
}
|
|
@@ -129,9 +127,11 @@ class Article extends Api |
|
@@ -129,9 +127,11 @@ class Article extends Api |
129
|
$where['a.user_id'] = ['=', $userId];
|
127
|
$where['a.user_id'] = ['=', $userId];
|
130
|
}
|
128
|
}
|
131
|
|
129
|
|
|
|
130
|
+ $where['a.deletetime'] = null;
|
|
|
131
|
+
|
132
|
// 获取文章
|
132
|
// 获取文章
|
133
|
$article = new ArticleModel();
|
133
|
$article = new ArticleModel();
|
134
|
- $articleList = $article->listByWhere($where, $page, $size, $studentInfo['school_id']);
|
134
|
+ $articleList = $article->listByWhere($where, $page, $size, $schoolIds);
|
135
|
if(!$articleList) {
|
135
|
if(!$articleList) {
|
136
|
$this->success('获取大学或学院的文章成功', $articleList);
|
136
|
$this->success('获取大学或学院的文章成功', $articleList);
|
137
|
}
|
137
|
}
|