数据库where增加[##]操作

This commit is contained in:
hoteas
2022-05-27 15:00:44 +08:00
parent b638d8bd65
commit c8a9038efe
+3
View File
@@ -711,6 +711,9 @@ func (that *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
k = "`" + k + "`"
}
where += " " + k + "=" + ObjToStr(v)
case "[##]": //直接添加value到sql,需要考虑防注入,value比如:"a>b"
where += " " + ObjToStr(v)
case "[#!]":
k = strings.Replace(k, "[#!]", "", -1)
if !strings.Contains(k, ".") {