|
@@ -20,12 +20,13 @@ type HomeClassifyItem struct {
|
|
|
Child *Report
|
|
|
}
|
|
|
|
|
|
-func ListHome(userId, maxPermission, userPermission int, permissionStr string) (items []*HomeList, err error) {
|
|
|
+func ListHome(userId, maxPermission, userPermission int, permissionStr string) (homeList []*HomeList, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("rddp")
|
|
|
//sql := `SELECT id,classify_name FROM classify WHERE parent_id=0 ORDER BY create_time ASC `
|
|
|
|
|
|
//暂时将双周报、月报隐藏
|
|
|
+ items := make([]*HomeList, 0)
|
|
|
sql := `SELECT id,classify_name FROM classify WHERE parent_id=0 and classify_name not IN("双周报","月报","晨报","周报","草根调研","需求报告","会议纪要","大事点评","年报合集") ORDER BY create_time ASC `
|
|
|
_, err = o.Raw(sql).QueryRows(&items)
|
|
|
if err != nil {
|
|
@@ -78,6 +79,9 @@ func ListHome(userId, maxPermission, userPermission int, permissionStr string) (
|
|
|
subItems[k].Child = report
|
|
|
}
|
|
|
items[i].Child = subItems
|
|
|
+ if lenSub > 0 {
|
|
|
+ homeList = append(homeList, items[i])
|
|
|
+ }
|
|
|
}
|
|
|
return
|
|
|
}
|