beego mysql in查询

beego mysql in查询

ids := strings.Split(group.Rules, ",")
var str string
for i := 0; i < len(ids); i++ {
    str += ",?"
}
str = tools.Substr(str, 1, len(str)-1)
var maps []orm.Params
var num int64
num, err = o.Raw("select name from ywt_rule where id in("+str+")", ids).Values(&maps)



你可能感兴趣的:(beego mysql in查询)