Skip to content

Commit

Permalink
filterview primarykey
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Apr 11, 2022
1 parent 4283633 commit f52b163
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions viewfn/filterview.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,22 @@ func (fv *FilterView) Prepare(r *evo.Request) {
if column.QueryBuilder != nil {
query = append(query, column.QueryBuilder(r)...)
} else {
var v string
if column.Select != "" {
v = r.Query(column.Select)
} else {
v = r.Query(column.Alias)
}
if v != "" {
q := column.SimpleFilter
for model, tb := range models {
q = strings.Replace(q, model+".", quote(tb)+".", -1)
if column.Select != "-" {
var v string
if column.Select != "" {
v = r.Query(column.Select)
} else {
v = r.Query(column.Alias)
}
if v != "" {
q := column.SimpleFilter
for model, tb := range models {
q = strings.Replace(q, model+".", quote(tb)+".", -1)
}
q = strings.Replace(q, "*", v, -1)

query = append(query, q)
}
q = strings.Replace(q, "*", v, -1)

query = append(query, q)
}
}
}
Expand Down

0 comments on commit f52b163

Please sign in to comment.