mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: tag query for mysql (#3785)
This commit is contained in:
@@ -92,7 +92,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
|
|||||||
}
|
}
|
||||||
if len(v.TagSearch) != 0 {
|
if len(v.TagSearch) != 0 {
|
||||||
for _, tag := range v.TagSearch {
|
for _, tag := range v.TagSearch {
|
||||||
where, args = append(where, "JSON_CONTAINS(JSON_EXTRACT(`memo`.`payload`, '$.property.tags'), ?)"), append(args, fmt.Sprintf(`%%"%s"%%`, tag))
|
where, args = append(where, "JSON_CONTAINS(JSON_EXTRACT(`memo`.`payload`, '$.property.tags'), ?)"), append(args, fmt.Sprintf(`"%s"`, tag))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if v.HasLink {
|
if v.HasLink {
|
||||||
|
Reference in New Issue
Block a user