|
@@ -66,18 +66,18 @@ func (m *menu) MenuSave() error {
|
|
|
|
|
|
if arr := strings.Split(m.GetString("topMenu"), ","); len(arr) > 0 {
|
|
|
for _, v := range arr {
|
|
|
- topMenu = append(topMenu, util.IntAll(v))
|
|
|
+ if v != "" {
|
|
|
+ topMenu = append(topMenu, util.IntAll(v))
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- topMenu = []int{0}
|
|
|
}
|
|
|
|
|
|
if arr := strings.Split(m.GetString("bottomLink"), ","); len(arr) > 0 {
|
|
|
for _, v := range arr {
|
|
|
- bottomLink = append(bottomLink, util.IntAll(v))
|
|
|
+ if v != "" {
|
|
|
+ bottomLink = append(bottomLink, util.IntAll(v))
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- bottomLink = []int{0}
|
|
|
}
|
|
|
|
|
|
doc := map[string]interface{}{
|
|
@@ -133,7 +133,7 @@ func (m *menu) MenuList() error {
|
|
|
currentPage, _ := m.GetInteger("currentPage")
|
|
|
res := map[string]interface{}{}
|
|
|
res["totalRows"] = mongodb.Count("jy_topMenu", nil)
|
|
|
- data := *mongodb.Find("jy_topMenu", nil, `{"i_sort":1,"l_createdate":1}`, `{"title":1,"i_status":1,"i_sort":1,"l_createdate":1,"l_modifydate":1,"top_menu":1,"bottom_link":1}`, false, (currentPage-1)*size, size)
|
|
|
+ data := *mongodb.Find("jy_topMenu", nil, `{"i_sort":1,"l_modifydate":-1,"_id":-1}`, `{"title":1,"i_status":1,"i_sort":1,"l_createdate":1,"l_modifydate":1,"top_menu":1,"bottom_link":1}`, false, (currentPage-1)*size, size)
|
|
|
for _, v := range data {
|
|
|
data_c := v["l_createdate"]
|
|
|
v["l_createdate"] = util.FormatDateWithObj(&data_c, util.Date_Full_Layout)
|