增加menu自动化添加功能

This commit is contained in:
2021-06-11 08:06:44 +08:00
parent 1077f09755
commit 32167d4721
5 changed files with 135 additions and 27 deletions
+20 -5
View File
@@ -84,24 +84,39 @@ var {{table}}Ctr = Ctr{
},
"search": func(that *Context) {
columnStr, where := that.MakeCode.Search(that.RouterString[1], that.Req)
reData := that.Db.Page(ObjToInt(that.Req.FormValue("page")), ObjToInt(that.Req.FormValue("pageRow"))).
Select(that.RouterString[1], columnStr, where)
page:=ObjToInt(that.Req.FormValue("page"))
pageSize:=ObjToInt(that.Req.FormValue("pageSize"))
if page<1{
page=1
}
if pageSize<=0{
pageSize=20
}
count:=that.Db.Count(that.RouterString[1], where)
reData := that.Db.Page(page, pageSize).
PageSelect(that.RouterString[1], columnStr, where)
for _, v := range reData {
for k, _ := range v {
column:=that.MakeCode.TableColumns[that.RouterString[1]][k]
if column==nil{
continue
}
if (column["list"]==nil||column.GetBool("list"))&&column.GetString("link")!=""{
v[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)})
}
}
}
that.Display(0, reData)
that.Display(0, Map{"count":count,"data":reData})
},
}
`