Эх сурвалжийг харах

Merge branch 'feature/v3.3.8_wky' of qmx/qfw into feature/v3.3.8

wangkaiyue 2 жил өмнө
parent
commit
8661ab434e

+ 7 - 7
core/src/qfw/manage/menu.go

@@ -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)

+ 0 - 4
core/src/web/templates/manage/menu/add.html

@@ -189,16 +189,12 @@ $(function(){
             for (let i = 0; i < obj["top_menu"].length; i++) {
                 $("input[name='topMenu'][value='"+obj["top_menu"][i]+"']").attr("checked","checked");
             }
-        }else {
-            $("input[name='topMenu'][value='0']").attr("checked","checked");
         }
 
         if (obj["bottom_link"]){
             for (let i = 0; i < obj["bottom_link"].length; i++) {
                 $("input[name='bottomLink'][value='"+obj["bottom_link"][i]+"']").attr("checked","checked");
             }
-        }else {
-            $("input[name='bottomLink'][value='0']").attr("checked","checked");
         }
 
 		$(obj["child"]).each(function(i,ad){

+ 3 - 3
core/src/web/templates/manage/menu/list.html

@@ -94,7 +94,7 @@ border-bottom:1px dashed #999999;
                     , field: "site",
                     callback: function (ct, cd, val, k, m) {
                         if (!ct["top_menu"]||ct["top_menu"].length===0) {
-                            return "剑鱼主站"
+                            return ""
                         }
                         let showValue = []
                         for (let i = 0; i < ct["top_menu"].length; i++) {
@@ -120,8 +120,8 @@ border-bottom:1px dashed #999999;
                     title: "底部链接"
                     , field: "position",
                     callback: function (ct, cd, val, k, m) {
-                        if (!ct["bottom_link"]) {
-                            return "剑鱼主站"
+                        if (!ct["bottom_link"]||ct["top_menu"].length===0) {
+                            return ""
                         }
                         let showValue = []
                         for (let i = 0; i < ct["bottom_link"].length; i++) {