Skip to content

Commit

Permalink
fix: Do not include custom pages when flipping
Browse files Browse the repository at this point in the history
  • Loading branch information
1379 authored and 1379 committed Jan 28, 2023
1 parent c4d1c08 commit 609156a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/impl/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (p postServiceImpl) CountLike(ctx context.Context) (int64, error) {
func (p postServiceImpl) GetPrevPosts(ctx context.Context, post *entity.Post, size int) ([]*entity.Post, error) {
postSort := p.OptionService.GetOrByDefault(ctx, property.IndexSort)
postDAL := dal.GetQueryByCtx(ctx).Post
postDO := postDAL.WithContext(ctx).Where(postDAL.Status.Eq(consts.PostStatusPublished))
postDO := postDAL.WithContext(ctx).Where(postDAL.Status.Eq(consts.PostStatusPublished), postDAL.Type.Eq(consts.PostTypePost))

switch postSort {
case "createTime":
Expand Down Expand Up @@ -291,7 +291,7 @@ func (p postServiceImpl) GetPrevPosts(ctx context.Context, post *entity.Post, si
func (p postServiceImpl) GetNextPosts(ctx context.Context, post *entity.Post, size int) ([]*entity.Post, error) {
postSort := p.OptionService.GetOrByDefault(ctx, property.IndexSort)
postDAL := dal.GetQueryByCtx(ctx).Post
postDO := postDAL.WithContext(ctx).Where(postDAL.Status.Eq(consts.PostStatusPublished))
postDO := postDAL.WithContext(ctx).Where(postDAL.Status.Eq(consts.PostStatusPublished), postDAL.Type.Eq(consts.PostTypePost))

switch postSort {
case "createTime":
Expand Down

0 comments on commit 609156a

Please sign in to comment.