...
|
...
|
@@ -330,7 +330,7 @@ func (repository *ArticleCommentRepository) Top5Comment(ctx context.Context, con |
|
|
}
|
|
|
|
|
|
func (repository *ArticleCommentRepository) CustomSearchBy(ctx context.Context, conn transaction.Conn, companyId int64, page int, size int,
|
|
|
topId int64, articleTitle string, contentLike string, fromUserName string, show int) (int, []*domain.ArticleCommentShow, error) {
|
|
|
topId int64, articleTitle string, contentLike string, fromUserName string, show int, createdAtRange [2]int64) (int, []*domain.ArticleCommentShow, error) {
|
|
|
|
|
|
if size <= 0 {
|
|
|
size = 20
|
...
|
...
|
@@ -364,6 +364,17 @@ func (repository *ArticleCommentRepository) CustomSearchBy(ctx context.Context, |
|
|
where += ` and article_comment."top_id"= ? `
|
|
|
condition = append(condition, topId)
|
|
|
}
|
|
|
|
|
|
if createdAtRange[0] > 0 {
|
|
|
where += ` and article_comment.created_at >=? `
|
|
|
condition = append(condition, createdAtRange[0])
|
|
|
}
|
|
|
|
|
|
if createdAtRange[1] > 0 {
|
|
|
where += ` and article_comment.created_at <=? `
|
|
|
condition = append(condition, createdAtRange[1])
|
|
|
}
|
|
|
|
|
|
countSql := `select
|
|
|
count(*)
|
|
|
from article_comment
|
...
|
...
|
|