作者 tangxvhui

修复查询条件缺失

... ... @@ -28,10 +28,10 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi
queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size)
if len(req.Category) > 0 {
queryOptions = queryOptions.MustWithKV("group", req.Category)
queryOptions = queryOptions.MustWithKV("group", "%"+req.Category+"%")
}
if len(req.TagName) > 0 {
queryOptions = queryOptions.MustWithKV("name", req.TagName)
queryOptions = queryOptions.MustWithKV("name", "%"+req.TagName+"%")
}
if len(req.Remark) > 0 {
... ...
... ... @@ -155,7 +155,9 @@ func (repository *ArticleTagRepository) Find(ctx context.Context, conn transacti
if v, ok := queryOptions["ids"]; ok {
tx = tx.Where("id in (?)", v)
}
if v, ok := queryOptions["remark"]; ok {
tx = tx.Where("remark like ?", v)
}
if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
return dms, tx.Error
}
... ...