最新博客
This commit is contained in:
@@ -44,6 +44,23 @@ class ArticleService extends BaseService
|
||||
]
|
||||
];
|
||||
},
|
||||
'home' => function ($params) {
|
||||
return [
|
||||
'filters' => $params['filters'],
|
||||
'fields' => ['id', 'locale', 'title', 'subtitle', 'cover', 'content', 'user_id', 'is_top', 'sort', 'status', 'publish_time', 'created_at', 'updated_at'],
|
||||
'relations' => [
|
||||
'creater' => ['id', 'nickname',],
|
||||
'comment' => ['id', 'article_id', 'content', 'avatar', 'name',],
|
||||
],
|
||||
'sorts' => [
|
||||
['field' => 'publish_time', 'direction' => 'desc'],
|
||||
],
|
||||
'pagination' => [
|
||||
'page' => $params['page'] ?? 1,
|
||||
'per_page' => $params['per_page'] ?? 3,
|
||||
]
|
||||
];
|
||||
},
|
||||
'show' => function ($params) {
|
||||
return [
|
||||
'filters' => [
|
||||
|
||||
Reference in New Issue
Block a user