aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2016-11-15 18:13:54 (UTC)
committerrtz12 <koenig@fagott.pw>2016-11-15 18:13:54 (UTC)
commit16e0a9a5ed4f61aec2fbda0fff921e92de732214 (patch)
treee47678959e75a709c76e4a85a95ff2aeff5c0799 /modules
parent599163277c774940b96043a5226faf68c50be9a1 (diff)
Man kann jetzt Listen auch mehr als nur ein mal öffnen. Danke Jan.
Diffstat (limited to 'modules')
-rw-r--r--modules/grils/grils.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go
index 0fac5df..b0aa486 100644
--- a/modules/grils/grils.go
+++ b/modules/grils/grils.go
@@ -201,13 +201,17 @@ func (m *GrilsModule) FromIDs(ids []int) ([]*models.Gril, error) {
201 idList += strconv.Itoa(v) 201 idList += strconv.Itoa(v)
202 } 202 }
203 idList += ")" 203 idList += ")"
204 grils, err := m.getGrils("id IN " + idList) 204 if len(idList) > 2 {
205 205 grils, err := m.getGrils("id IN " + idList)
206 for _, g := range grils { 206 if err != nil {
207 list = append(list, g) 207 return nil, err
208 }
209 for _, g := range grils {
210 list = append(list, g)
211 }
208 } 212 }
209 log.Printf("get_gril_from_ids: %dms", time.Since(t1).Nanoseconds()/1000000) 213 log.Printf("get_gril_from_ids: %dms", time.Since(t1).Nanoseconds()/1000000)
210 return list, err 214 return list, nil
211} 215}
212 216
213func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) { 217func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) {