增加menu自动化添加功能
This commit is contained in:
+20
-5
@@ -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})
|
||||
},
|
||||
}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user