|
@@ -76,10 +76,10 @@ class Article extends Api |
|
@@ -76,10 +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
|
+// $myId = 25;
|
80
|
|
80
|
|
81
|
$universityId = $this->request->param('university_id', 0, 'int');
|
81
|
$universityId = $this->request->param('university_id', 0, 'int');
|
82
|
- $universityId = 892;
|
82
|
+// $universityId = 892;
|
83
|
|
83
|
|
84
|
$collegeId = $this->request->param('college_id', 0, 'int');
|
84
|
$collegeId = $this->request->param('college_id', 0, 'int');
|
85
|
|
85
|
|
|
@@ -413,8 +413,19 @@ class Article extends Api |
|
@@ -413,8 +413,19 @@ class Article extends Api |
413
|
foreach ($articleTypeList as $k => $v) {
|
413
|
foreach ($articleTypeList as $k => $v) {
|
414
|
$articleTypeListObj[$v['id']] = $v;
|
414
|
$articleTypeListObj[$v['id']] = $v;
|
415
|
}
|
415
|
}
|
|
|
416
|
+ $student = new Student();
|
416
|
|
417
|
|
417
|
foreach ($lookArticleList as $k => $v) {
|
418
|
foreach ($lookArticleList as $k => $v) {
|
|
|
419
|
+
|
|
|
420
|
+ $userInfo = $student->infoByUserId($v['user_id']);
|
|
|
421
|
+ if($userInfo) {
|
|
|
422
|
+ $lookArticleList[$k]['nickname'] = $userInfo['nickname'];
|
|
|
423
|
+ $lookArticleList[$k]['head_image'] = $userInfo['head_image'];
|
|
|
424
|
+ } else {
|
|
|
425
|
+ $lookArticleList[$k]['nickname'] = '';
|
|
|
426
|
+ $lookArticleList[$k]['head_image'] = '';
|
|
|
427
|
+ }
|
|
|
428
|
+
|
418
|
if(isset($likeStudentListObj[$v['user_id']])) {
|
429
|
if(isset($likeStudentListObj[$v['user_id']])) {
|
419
|
$lookArticleList[$k]['is_like_user'] = 1;
|
430
|
$lookArticleList[$k]['is_like_user'] = 1;
|
420
|
} else {
|
431
|
} else {
|
|
@@ -811,7 +822,7 @@ class Article extends Api |
|
@@ -811,7 +822,7 @@ class Article extends Api |
811
|
}
|
822
|
}
|
812
|
|
823
|
|
813
|
if($articleInfo['user_id'] != $userId) {
|
824
|
if($articleInfo['user_id'] != $userId) {
|
814
|
- $this->error('');
|
825
|
+ $this->error('不能删除他人文章');
|
815
|
}
|
826
|
}
|
816
|
|
827
|
|
817
|
$res = $articleModel->delOne($articleId, ['deletetime' => time()]);
|
828
|
$res = $articleModel->delOne($articleId, ['deletetime' => time()]);
|