作者 tangxvhui

调整查询错误

... ... @@ -31,8 +31,7 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr
queryOption := domain.NewQueryOptions().
WithOffsetLimit(req.Page, req.Size).
MustWithKV("article_id", req.ArticleId).
MustWithKV("company_id", req.CompanyId)
MustWithKV("articleId", req.ArticleId)
cnt, backupList, err := l.svcCtx.ArticleBackupRepository.Find(l.ctx, conn, queryOption)
if err != nil {
... ...
... ... @@ -129,6 +129,9 @@ func (repository *ArticleBackupRepository) Find(ctx context.Context, conn transa
if v, ok := queryOptions["articleId"]; ok {
tx = tx.Where("article_id = ?", v)
}
if v, ok := queryOptions["companyId"]; ok {
tx = tx.Where("article_id = ?", v)
}
if v, ok := queryOptions["operator"]; ok && v.(string) != "" {
tx = tx.Where(`operator #>> '{"name"}' like ?`, "%"+v.(string)+"%")
}
... ...