fix(makecode): Search 文本字段只走模糊匹配,避免等值叠加导致空结果
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-1
@@ -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
|
||||
}
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user