This commit is contained in:
hoteas 2017-12-03 18:38:03 +00:00
parent 80c7f64162
commit 4b37804b01

17
db.go
View File

@ -628,14 +628,19 @@ func (this *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
if reflect.ValueOf(v).Type().String() == "hotime.Slice" {
where += "`" + k + "` IN ("
res = append(res, (v.(Slice))...)
for i := 0; i < len(v.(Slice)); i++ {
if i+1 != len(v.(Slice)) {
where += "?,"
} else {
where += "?) "
if len(v.(Slice))==0{
where+=") "
}else{
for i := 0; i < len(v.(Slice)); i++ {
if i+1 != len(v.(Slice)) {
where += "?,"
} else {
where += "?) "
}
//res=append(res,(v.(Slice))[i])
}
//res=append(res,(v.(Slice))[i])
}
} else {
where += "`" + k + "`=? "
res = append(res, v)