接入搜索功能

This commit is contained in:
2021-06-13 03:08:43 +08:00
parent 5c8df885a2
commit 8b6dd5fdad
2 changed files with 75 additions and 8 deletions
+3 -3
View File
@@ -708,7 +708,7 @@ func (that *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
res = append(res, v.(Slice)[0])
res = append(res, v.(Slice)[1])
default:
if reflect.ValueOf(v).Type().String() == "hotime.Slice" {
if reflect.ValueOf(v).Type().String() == "common.Slice" {
where += "`" + k + "` IN ("
res = append(res, v.(Slice)...)
if len(v.(Slice)) == 0 {
@@ -739,7 +739,7 @@ func (that *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
//fmt.Println(reflect.ValueOf(v).Type().String())
if v == nil {
where += "`" + k + "` IS NULL"
} else if reflect.ValueOf(v).Type().String() == "hotime.Slice" {
} else if reflect.ValueOf(v).Type().String() == "common.Slice" {
//fmt.Println(v)
where += "`" + k + "` IN ("
@@ -782,7 +782,7 @@ func (that *HoTimeDB) notIn(k string, v interface{}, where string, res []interfa
where += "`" + k + "` IS NOT NULL "
} else if reflect.ValueOf(v).Type().String() == "hotime.Slice" {
} else if reflect.ValueOf(v).Type().String() == "common.Slice" {
where += "`" + k + "` NOT IN ("
res = append(res, v.(Slice)...)
for i := 0; i < len(v.(Slice)); i++ {