From a392b07b622910712a627ee15bb17218d8058c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Thu, 29 Sep 2016 16:00:43 +0200 Subject: [PATCH] navigation --- list_config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/list_config.go b/list_config.go index e45583d..366674c 100644 --- a/list_config.go +++ b/list_config.go @@ -207,15 +207,15 @@ func setListParams(db *ora.Ses, list *ListConfig, objType string) error { return nil } -func getListNavigation(db *ora.Ses, objType string) ([]ListNavNode, error) { +func getListNavigation(db *ora.Ses, listObjType string) ([]ListNavNode, error) { resp := make([]ListNavNode, 0) var err error var stmt *ora.Stmt query := `SELECT - a.OBJECT_TYPE, a.LABEL, a.ICON, b.LIST_OBJECT_TYPE, b.PARENT_ID_FIELD, b.RB - FROM LIST_CONFIG_CHILD a - JOIN LIST_CONFIG_NAVIGATION b ON a.PARENT_CHILD_ID = b.PARENT_CHILD_ID - WHERE a.PARENT_OBJECT_TYPE = '`+objType+`' + a.OBJECT_TYPE, a.PARENT_OBJECT_TYPE, a.LABEL, a.ICON, b.PARENT_ID_FIELD, b.RB + FROM LIST_CONFIG_NAVIGATION b + JOIN LIST_CONFIG_CHILD a ON b.PARENT_CHILD_ID = a.PARENT_CHILD_ID + WHERE b.LIST_OBJECT_TYPE = '`+listObjType+`' ORDER BY b.RB ASC` stmt, err = db.Prep(query, ora.S, ora.S, ora.S, ora.S, ora.S) @@ -231,9 +231,9 @@ func getListNavigation(db *ora.Ses, objType string) ([]ListNavNode, error) { for rset.Next() { resp = append(resp, ListNavNode{ ObjectType: rset.Row[0].(string), - LabelField: rset.Row[1].(string), - Icon: rset.Row[2].(string), - ParentObjectType: rset.Row[3].(string), + ParentObjectType: rset.Row[1].(string), + LabelField: rset.Row[2].(string), + Icon: rset.Row[3].(string), ParentIdField: rset.Row[4].(string), }) } -- 1.8.1.2