正在显示
2 个修改的文件
包含
5 行增加
和
3 行删除
@@ -28,10 +28,10 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi | @@ -28,10 +28,10 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi | ||
28 | queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size) | 28 | queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size) |
29 | 29 | ||
30 | if len(req.Category) > 0 { | 30 | if len(req.Category) > 0 { |
31 | - queryOptions = queryOptions.MustWithKV("group", req.Category) | 31 | + queryOptions = queryOptions.MustWithKV("group", "%"+req.Category+"%") |
32 | } | 32 | } |
33 | if len(req.TagName) > 0 { | 33 | if len(req.TagName) > 0 { |
34 | - queryOptions = queryOptions.MustWithKV("name", req.TagName) | 34 | + queryOptions = queryOptions.MustWithKV("name", "%"+req.TagName+"%") |
35 | } | 35 | } |
36 | 36 | ||
37 | if len(req.Remark) > 0 { | 37 | if len(req.Remark) > 0 { |
@@ -155,7 +155,9 @@ func (repository *ArticleTagRepository) Find(ctx context.Context, conn transacti | @@ -155,7 +155,9 @@ func (repository *ArticleTagRepository) Find(ctx context.Context, conn transacti | ||
155 | if v, ok := queryOptions["ids"]; ok { | 155 | if v, ok := queryOptions["ids"]; ok { |
156 | tx = tx.Where("id in (?)", v) | 156 | tx = tx.Where("id in (?)", v) |
157 | } | 157 | } |
158 | - | 158 | + if v, ok := queryOptions["remark"]; ok { |
159 | + tx = tx.Where("remark like ?", v) | ||
160 | + } | ||
159 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { | 161 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { |
160 | return dms, tx.Error | 162 | return dms, tx.Error |
161 | } | 163 | } |
-
请 注册 或 登录 后发表评论