fix(makecode): Search 文本字段只走模糊匹配,避免等值叠加导致空结果

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-23 06:15:07 +08:00
parent b5b764e3f9
commit 853940c795
3 changed files with 56 additions and 1 deletions
+5 -1
View File
@@ -980,7 +980,11 @@ func (that *MakeCode) Search(table string, userData Map, data Map, req *http.Req
// }
//
reqValue := req.FormValue(v.GetString("name"))
if v.GetString("name") != "parent_id" && reqValue != "" {
// text 类字段只走下方模糊匹配([~]),此处不再生成等值条件,
// 否则等值(必不命中部分关键词)与模糊匹配在 where 中以 AND 叠加,
// 查询恒为空(见 docs/CodeGen_代码生成.md 通用 Search 筛选说明)。
if v.GetString("name") != "parent_id" && reqValue != "" &&
!strings.Contains(v.GetString("type"), "text") {
data[v.GetString("name")] = reqValue
}
//