From 609156a58a85909ed9839ec0bd1f7d4b9cbb07de Mon Sep 17 00:00:00 2001 From: 1379 <1379@1379.com> Date: Sat, 28 Jan 2023 14:28:13 +0800 Subject: [PATCH] fix: Do not include custom pages when flipping --- service/impl/post.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/impl/post.go b/service/impl/post.go index fa99f080..a16d3693 100644 --- a/service/impl/post.go +++ b/service/impl/post.go @@ -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": @@ -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":