update implements of FilterTargets()

This commit is contained in:
Wenkai Yin 2016-06-13 08:54:42 +08:00
parent e5fe595f62
commit e05ff0373b

View File

@ -68,10 +68,13 @@ func FilterRepTargets(name string) ([]*models.RepTarget, error) {
}
o := GetOrmer()
var args []string
args = append(args, "%"+name+"%")
var targets []*models.RepTarget
sql := "select * from replication_target where name like ?"
if _, err := o.Raw(sql, "%"+name+"%").QueryRows(targets); err != nil {
if _, err := o.Raw(sql, args).QueryRows(targets); err != nil {
return nil, err
}