This commit is contained in:
parent
80c7f64162
commit
4b37804b01
17
db.go
17
db.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user