From 68f2c0fd8f55f3391fc7c22ab973d45c68f16e5b Mon Sep 17 00:00:00 2001 From: hoteas Date: Mon, 7 Nov 2022 01:40:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/makecode.go | 8 +- example/config/adminDB.json | 674 ++++++++++++++++++------------------ 2 files changed, 341 insertions(+), 341 deletions(-) diff --git a/code/makecode.go b/code/makecode.go index 18317c3..85906a9 100644 --- a/code/makecode.go +++ b/code/makecode.go @@ -1113,10 +1113,10 @@ func (that *MakeCode) Search(table string, userData Map, data Map, req *http.Req childs := db.Select(v.GetString("link"), "id", Map{v.GetString("value") + "[~]": keywordStr}) childIds := Slice{} for _, cv := range childs { - childIds = append(childIds, cv.GetString("id")) + childIds = append(childIds, cv.GetCeilInt64("id")) } if len(childIds) != 0 { - data[v.GetString("link")+".id"] = childIds + data[v.GetString("name")] = childIds } } continue @@ -1134,10 +1134,10 @@ func (that *MakeCode) Search(table string, userData Map, data Map, req *http.Req childs := db.Select(v.GetString("link"), "id", Map{v.GetString("value") + "[~]": keywordStr}) childIds := Slice{} for _, cv := range childs { - childIds = append(childIds, cv.GetString("id")) + childIds = append(childIds, cv.GetCeilInt64("id")) } if len(childIds) != 0 { - keyword[v.GetString("link")+".id"] = childIds + keyword[v.GetString("name")] = childIds } } diff --git a/example/config/adminDB.json b/example/config/adminDB.json index 55d8925..737fd9c 100644 --- a/example/config/adminDB.json +++ b/example/config/adminDB.json @@ -74,8 +74,20 @@ "show" ], "icon": "Setting", - "label": "ebw_annex", + "label": "ebw_items", "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "ebw_items", + "table": "ebw_items" + }, { "auth": [ "show", @@ -88,30 +100,6 @@ "label": "ebw_annex", "table": "ebw_annex" }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "ebw_attachment", - "table": "ebw_attachment" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "ebw_jobs", - "table": "ebw_jobs" - }, { "auth": [ "show", @@ -133,20 +121,8 @@ "info", "download" ], - "label": "ebw_res", - "table": "ebw_res" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "ebw_vote_user", - "table": "ebw_vote_user" + "label": "ebw_user", + "table": "ebw_user" }, { "auth": [ @@ -169,8 +145,8 @@ "info", "download" ], - "label": "ebw_news_addition_res", - "table": "ebw_news_addition_res" + "label": "ebw_res", + "table": "ebw_res" }, { "auth": [ @@ -181,8 +157,32 @@ "info", "download" ], - "label": "ebw_items", - "table": "ebw_items" + "label": "ebw_jobs", + "table": "ebw_jobs" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "ebw_attachment", + "table": "ebw_attachment" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "ebw_vote", + "table": "ebw_vote" }, { "auth": [ @@ -205,8 +205,8 @@ "info", "download" ], - "label": "ebw_user", - "table": "ebw_user" + "label": "ebw_vote_user", + "table": "ebw_vote_user" }, { "auth": [ @@ -217,8 +217,8 @@ "info", "download" ], - "label": "ebw_vote", - "table": "ebw_vote" + "label": "ebw_news_addition_res", + "table": "ebw_news_addition_res" } ], "name": "sys:ebw" @@ -228,7 +228,7 @@ "show" ], "icon": "Setting", - "label": "飘窗", + "label": "底部", "menus": [ { "auth": [ @@ -239,8 +239,8 @@ "info", "download" ], - "label": "飘窗", - "table": "swiper_fly" + "label": "底部", + "table": "swiper_bottom" }, { "auth": [ @@ -254,6 +254,18 @@ "label": "外部系统", "table": "swiper_sys" }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "飘窗", + "table": "swiper_fly" + }, { "auth": [ "show", @@ -289,134 +301,10 @@ ], "label": "中间", "table": "swiper_center" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "底部", - "table": "swiper_bottom" } ], "name": "sys:swiper" }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "系统管理", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "文章管理", - "table": "article" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "人员管理", - "table": "admin" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "组织管理", - "table": "org" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "角色管理", - "table": "role" - }, - { - "auth": [ - "show", - "download" - ], - "label": "日志管理", - "table": "logs" - } - ], - "name": "sys" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "栏目管理", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "栏目管理", - "table": "ctg" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "栏目管理", - "table": "ctg_copy" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "关联栏目", - "table": "ctg_article" - } - ], - "name": "sys:ctg" - }, { "auth": [ "show" @@ -462,6 +350,118 @@ } ], "name": "sys:mail" + }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "系统管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "人员管理", + "table": "admin" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "文章管理", + "table": "article" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "角色管理", + "table": "role" + }, + { + "auth": [ + "show", + "download" + ], + "label": "日志管理", + "table": "logs" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "组织管理", + "table": "org" + } + ], + "name": "sys" + }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "关联栏目", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "关联栏目", + "table": "ctg_article" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "栏目管理", + "table": "ctg_copy" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "栏目管理", + "table": "ctg" + } + ], + "name": "sys:ctg" } ], "name": "admin", @@ -569,14 +569,14 @@ "name": "无", "value": null }, - { - "name": "ID", - "value": "id" - }, { "name": "名称", "value": "name" }, + { + "name": "ID", + "value": "id" + }, { "name": "手机号", "value": "phone" @@ -597,13 +597,13 @@ "name": "无", "value": null }, - { - "name": "变更时间", - "value": "modify_time" - }, { "name": "创建时间", "value": "create_time" + }, + { + "name": "变更时间", + "value": "modify_time" } ], "type": "search", @@ -788,28 +788,28 @@ "value": null }, { - "name": "id", - "value": "id" + "name": "来源", + "value": "origin" }, { "name": "作者", "value": "author" }, - { - "name": "编号", - "value": "sn" - }, { "name": "描述", "value": "description" }, { - "name": "标题", - "value": "title" + "name": "编号", + "value": "sn" }, { - "name": "来源", - "value": "origin" + "name": "id", + "value": "id" + }, + { + "name": "标题", + "value": "title" }, { "name": "正文", @@ -827,14 +827,14 @@ "name": "无", "value": null }, - { - "name": "变更时间", - "value": "modify_time" - }, { "name": "创建时间", "value": "create_time" }, + { + "name": "变更时间", + "value": "modify_time" + }, { "name": "推送时间", "value": "push_time" @@ -1019,24 +1019,24 @@ "value": null }, { - "name": "板块名称", - "value": "name" - }, - { - "name": "源链接", - "value": "url" + "name": "文章", + "value": "article_id" }, { "name": "ID", "value": "id" }, + { + "name": "板块名称", + "value": "name" + }, { "name": "编码", "value": "sn" }, { - "name": "文章", - "value": "article_id" + "name": "源链接", + "value": "url" } ], "type": "search", @@ -1050,13 +1050,13 @@ "name": "无", "value": null }, - { - "name": "创建时间", - "value": "create_time" - }, { "name": "变更时间", "value": "modify_time" + }, + { + "name": "创建时间", + "value": "create_time" } ], "type": "search", @@ -1420,20 +1420,20 @@ "value": "id" }, { - "name": "板块名称", - "value": "name" + "name": "编码", + "value": "sn" }, { "name": "源链接", "value": "url" }, { - "name": "文章", - "value": "article_id" + "name": "板块名称", + "value": "name" }, { - "name": "编码", - "value": "sn" + "name": "文章", + "value": "article_id" } ], "type": "search", @@ -1447,13 +1447,13 @@ "name": "无", "value": null }, - { - "name": "创建时间", - "value": "create_time" - }, { "name": "变更时间", "value": "modify_time" + }, + { + "name": "创建时间", + "value": "create_time" } ], "type": "search", @@ -2460,16 +2460,8 @@ "value": null }, { - "name": "tel", - "value": "tel" - }, - { - "name": "depName", - "value": "depName" - }, - { - "name": "id", - "value": "id" + "name": "no", + "value": "no" }, { "name": "name", @@ -2480,16 +2472,20 @@ "value": "pass" }, { - "name": "adrress", - "value": "adrress" + "name": "tel", + "value": "tel" }, { - "name": "depNo", - "value": "depNo" + "name": "mail", + "value": "mail" }, { - "name": "no", - "value": "no" + "name": "depName", + "value": "depName" + }, + { + "name": "id", + "value": "id" }, { "name": "account", @@ -2500,12 +2496,16 @@ "value": "mpass" }, { - "name": "mail", - "value": "mail" + "name": "adrress", + "value": "adrress" }, { "name": "type", "value": "type" + }, + { + "name": "depNo", + "value": "depNo" } ], "type": "search", @@ -2946,10 +2946,6 @@ "name": "无", "value": null }, - { - "name": "IP地址", - "value": "ip" - }, { "name": "其他内容", "value": "name" @@ -2957,6 +2953,10 @@ { "name": "ID", "value": "id" + }, + { + "name": "IP地址", + "value": "ip" } ], "type": "search", @@ -3444,18 +3444,6 @@ "name": "无", "value": null }, - { - "name": "编号", - "value": "sn" - }, - { - "name": "内容", - "value": "content" - }, - { - "name": "姓名", - "value": "name" - }, { "name": "IP", "value": "not_show_ip" @@ -3465,12 +3453,24 @@ "value": "id" }, { - "name": "标题", - "value": "title" + "name": "内容", + "value": "content" }, { "name": "手机号", "value": "phone" + }, + { + "name": "编号", + "value": "sn" + }, + { + "name": "标题", + "value": "title" + }, + { + "name": "姓名", + "value": "name" } ], "type": "search", @@ -3484,13 +3484,13 @@ "name": "无", "value": null }, - { - "name": "创建时间", - "value": "create_time" - }, { "name": "变更时间", "value": "modify_time" + }, + { + "name": "创建时间", + "value": "create_time" } ], "type": "search", @@ -3534,27 +3534,6 @@ "type": "select", "value": null }, - { - "label": "是否展示", - "name": "show", - "options": [ - { - "name": "否", - "value": "0" - }, - { - "name": "是", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "sortable": true, - "type": "select", - "value": null - }, { "label": "进展", "name": "status", @@ -3578,6 +3557,27 @@ ], "type": "select", "value": null + }, + { + "label": "是否展示", + "name": "show", + "options": [ + { + "name": "否", + "value": "0" + }, + { + "name": "是", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null } ], "table": "mail_discipline" @@ -3710,32 +3710,32 @@ "value": null }, { - "name": "内容", - "value": "content" + "name": "id", + "value": "id" }, { "name": "姓名", "value": "name" }, + { + "name": "手机号", + "value": "phone" + }, { "name": "IP", "value": "not_show_ip" }, { - "name": "id", - "value": "id" + "name": "编号", + "value": "sn" }, { "name": "标题", "value": "title" }, { - "name": "手机号", - "value": "phone" - }, - { - "name": "编号", - "value": "sn" + "name": "内容", + "value": "content" } ], "type": "search", @@ -3749,13 +3749,13 @@ "name": "无", "value": null }, - { - "name": "变更时间", - "value": "modify_time" - }, { "name": "创建时间", "value": "create_time" + }, + { + "name": "变更时间", + "value": "modify_time" } ], "type": "search", @@ -3955,10 +3955,6 @@ "name": "无", "value": null }, - { - "name": "ID", - "value": "id" - }, { "name": "编码", "value": "sn" @@ -3966,6 +3962,10 @@ { "name": "板块名称", "value": "name" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -3979,13 +3979,13 @@ "name": "无", "value": null }, - { - "name": "创建时间", - "value": "create_time" - }, { "name": "变更时间", "value": "modify_time" + }, + { + "name": "创建时间", + "value": "create_time" } ], "type": "search", @@ -4431,13 +4431,13 @@ "name": "无", "value": null }, - { - "name": "创建时间", - "value": "create_time" - }, { "name": "变更时间", "value": "modify_time" + }, + { + "name": "创建时间", + "value": "create_time" } ], "type": "search", @@ -4595,10 +4595,6 @@ "name": "无", "value": null }, - { - "name": "名称", - "value": "name" - }, { "name": "ID", "value": "id" @@ -4606,6 +4602,10 @@ { "name": "链接", "value": "url" + }, + { + "name": "名称", + "value": "name" } ], "type": "search", @@ -4619,13 +4619,13 @@ "name": "无", "value": null }, - { - "name": "创建时间", - "value": "create_time" - }, { "name": "变更时间", "value": "modify_time" + }, + { + "name": "创建时间", + "value": "create_time" } ], "type": "search", @@ -4649,6 +4649,26 @@ "type": "search", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "label": "位置", "name": "pos", @@ -4677,26 +4697,6 @@ "sortable": true, "type": "select", "value": null - }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "正常", - "value": "0" - }, - { - "name": "异常", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null } ], "table": "swiper_fly" @@ -4942,10 +4942,6 @@ "name": "无", "value": null }, - { - "name": "链接", - "value": "url" - }, { "name": "ID", "value": "id" @@ -4953,6 +4949,10 @@ { "name": "名称", "value": "name" + }, + { + "name": "链接", + "value": "url" } ], "type": "search",