This commit is contained in:
hoteas 2021-06-18 04:56:22 +08:00
parent 00ad6487b6
commit efb6cb980e

View File

@ -625,18 +625,18 @@ func (that *MakeCode) Search(table string, req *http.Request, db *db.HoTimeDB) (
continue
}
//树节点模式搜索
if searchItemName == "parent_id" {
parentID := ObjToInt(req.FormValue("parent_id"))
if parentID == 0 {
data["OR"] = Map{table + ".parent_id[#]": 0, table + ".parent_id": nil}
} else {
data[table+".parent_id"] = parentID
}
continue
}
data[table+"."+searchItemName] = reqValue
}
//树节点模式搜索
if req.Form["parent_id"] != nil {
parentID := ObjToInt(req.FormValue("parent_id"))
if parentID == 0 {
data["OR"] = Map{table + ".parent_id[#]": 0, table + ".parent_id": nil}
} else {
data[table+".parent_id"] = parentID
}
}