diff options
author | rtz12 <koenig@fagott.pw> | 2015-12-29 19:41:42 (UTC) |
---|---|---|
committer | rtz12 <koenig@fagott.pw> | 2015-12-29 19:41:42 (UTC) |
commit | c2498d562d3e30e4795056058fc3d8a5cec4ec11 (patch) | |
tree | f560375a0a6217edf7c9ac6e8753a09eb775b831 /modules/grils | |
parent | 43e206d8627ccdb94ad729d9d48d66484faba117 (diff) |
Tagansicht hinzugefuegt
Diffstat (limited to 'modules/grils')
-rw-r--r-- | modules/grils/grils.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go index 7ea5259..46d0fb3 100644 --- a/modules/grils/grils.go +++ b/modules/grils/grils.go | |||
@@ -156,6 +156,22 @@ func (m *GrilsModule) FromID(id int) (*Gril, error) { | |||
156 | return gril, nil | 156 | return gril, nil |
157 | } | 157 | } |
158 | 158 | ||
159 | func (m *GrilsModule) FromIDs(ids []int) ([]*Gril, error) { | ||
160 | idList := "(" | ||
161 | first := true | ||
162 | for _, v := range ids { | ||
163 | if first { | ||
164 | first = false | ||
165 | } else { | ||
166 | idList += "," | ||
167 | } | ||
168 | idList += strconv.Itoa(v) | ||
169 | } | ||
170 | idList += ")" | ||
171 | grils, err := m.getGrils("id IN " + idList) | ||
172 | return grils, err | ||
173 | } | ||
174 | |||
159 | func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) { | 175 | func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) { |
160 | user, _ := m.g.Charakterin.GetUserFromRequest(r) | 176 | user, _ := m.g.Charakterin.GetUserFromRequest(r) |
161 | sid := p.ByName("id") | 177 | sid := p.ByName("id") |