mirror of
https://github.com/beego/bee.git
synced 2024-11-01 00:00:53 +00:00
allow dot notation in query field
This commit is contained in:
parent
337bd38b73
commit
06f2e2cca9
@ -632,6 +632,8 @@ func GetAll{{modelName}}(query map[string]string, fields []string, sortby []stri
|
|||||||
qs := o.QueryTable(new({{modelName}}))
|
qs := o.QueryTable(new({{modelName}}))
|
||||||
// query k=v
|
// query k=v
|
||||||
for k, v := range query {
|
for k, v := range query {
|
||||||
|
// rewrite dot-notation to Object__Attribute
|
||||||
|
k = strings.Replace(k, ".", "__", -1)
|
||||||
qs = qs.Filter(k, v)
|
qs = qs.Filter(k, v)
|
||||||
}
|
}
|
||||||
// order by:
|
// order by:
|
||||||
|
Loading…
Reference in New Issue
Block a user