This commit is contained in:
parent
80c7f64162
commit
4b37804b01
5
db.go
5
db.go
@ -628,6 +628,9 @@ 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))...)
|
||||
if len(v.(Slice))==0{
|
||||
where+=") "
|
||||
}else{
|
||||
for i := 0; i < len(v.(Slice)); i++ {
|
||||
if i+1 != len(v.(Slice)) {
|
||||
where += "?,"
|
||||
@ -636,6 +639,8 @@ func (this *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
|
||||
}
|
||||
//res=append(res,(v.(Slice))[i])
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
where += "`" + k + "`=? "
|
||||
res = append(res, v)
|
||||
|
Loading…
Reference in New Issue
Block a user