mirror of
https://github.com/beego/bee.git
synced 2024-11-26 06:21:34 +00:00
isnull filter needs boolean value for the Filter function
This commit is contained in:
parent
f7d2e04e07
commit
87e2237f5b
10
g_appcode.go
10
g_appcode.go
@ -1062,7 +1062,15 @@ func GetAll{{modelName}}(query map[string]string, fields []string, sortby []stri
|
||||
for k, v := range query {
|
||||
// rewrite dot-notation to Object__Attribute
|
||||
k = strings.Replace(k, ".", "__", -1)
|
||||
qs = qs.Filter(k, v)
|
||||
if strings.Contains(k, "isnull") {
|
||||
var v2 bool
|
||||
if v == "true" || v == "1" {
|
||||
v2 = true
|
||||
}
|
||||
qs = qs.Filter(k, v2)
|
||||
} else {
|
||||
qs = qs.Filter(k, v)
|
||||
}
|
||||
}
|
||||
// order by:
|
||||
var sortFields []string
|
||||
|
Loading…
Reference in New Issue
Block a user