v7.0.0-beta.2 release
This commit is contained in:
1 parent
5d4890d6fb
commit
d1e274165a
64 files changed
+5988
-316
No files matched your search
@@ -302,6 +302,26 @@ class PostRepository implements PostRepositoryInterface
|
||||
return $post?->view_count ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 해당 게시판의 게시글이 공지글인지 경량 조회합니다.
|
||||
*
|
||||
* 존재하지 않으면 null을 반환합니다. trashed(`deleted_at`) 여부는 고려하지 않으며
|
||||
* 스코프/권한 체크를 수행하지 않습니다.
|
||||
*
|
||||
* @param int $id 게시글 ID
|
||||
* @param int $boardId 게시판 ID
|
||||
* @return bool|null 공지 여부 또는 미존재 시 null
|
||||
*/
|
||||
public function isNotice(int $id, int $boardId): ?bool
|
||||
{
|
||||
$value = Post::withTrashed()
|
||||
->where('id', $id)
|
||||
->where('board_id', $boardId)
|
||||
->value('is_notice');
|
||||
|
||||
return $value === null ? null : (bool) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 신고 처리를 위한 게시글 상태를 일괄 업데이트합니다.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user