|
@@ -5,6 +5,7 @@ import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
+ "github.com/gogf/gf/v2/util/gconv"
|
|
|
"jyseo/utility"
|
|
|
"log"
|
|
|
"runtime"
|
|
@@ -67,6 +68,24 @@ type (
|
|
|
TopMenuMap map[int][]*TopMenuItem //顶部
|
|
|
BottomLinkMap map[int][]*TopMenuItem //底部
|
|
|
}
|
|
|
+
|
|
|
+ Menu struct {
|
|
|
+ Name string `json:"name"`
|
|
|
+ Layout string `json:"layout"`
|
|
|
+ Href string `json:"href,omitempty"`
|
|
|
+ Childs []struct {
|
|
|
+ Name string `json:"name"`
|
|
|
+ Desc string `json:"desc"`
|
|
|
+ Childs []struct {
|
|
|
+ Name string `json:"name"`
|
|
|
+ Href string `json:"href,omitempty"`
|
|
|
+ Childs []struct {
|
|
|
+ Name string `json:"name"`
|
|
|
+ Href string `json:"href,omitempty"`
|
|
|
+ } `json:"childs,omitempty"`
|
|
|
+ } `json:"childs"`
|
|
|
+ } `json:"childs"`
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
func Ad(s_code string, n int) []adInfo {
|
|
@@ -252,3 +271,16 @@ func BottomLink(flag int) (rData *SiteMenu) {
|
|
|
MenuList: cacheMenu.BottomLinkMap[flag],
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func TopMenuNew() []*Menu {
|
|
|
+ var newMenus []*Menu
|
|
|
+ list, _ := utility.MG.DB().Find("jy_topMenu_new", `{"i_status":1}`, `{"i_sort":1}`, nil, false, -1, -1)
|
|
|
+ if list == nil || len(*list) == 0 {
|
|
|
+ return newMenus
|
|
|
+ }
|
|
|
+ if err := gconv.Struct(list, &newMenus); err != nil {
|
|
|
+ log.Println("获取菜单异常", err.Error())
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return newMenus
|
|
|
+}
|