接入搜索功能
This commit is contained in:
+5
-4
@@ -85,10 +85,10 @@ var {{table}}Ctr = Ctr{
|
||||
"search": func(that *Context) {
|
||||
|
||||
|
||||
columnStr, where := that.MakeCode.Search(that.RouterString[1], that.Req)
|
||||
columnStr,leftJoin,where := that.MakeCode.Search(that.RouterString[1], that.Req,that.Db)
|
||||
page:=ObjToInt(that.Req.FormValue("page"))
|
||||
pageSize:=ObjToInt(that.Req.FormValue("pageSize"))
|
||||
|
||||
|
||||
if page<1{
|
||||
page=1
|
||||
}
|
||||
@@ -96,9 +96,10 @@ var {{table}}Ctr = Ctr{
|
||||
if pageSize<=0{
|
||||
pageSize=20
|
||||
}
|
||||
count:=that.Db.Count(that.RouterString[1], where)
|
||||
|
||||
count:=that.Db.Count(that.RouterString[1],leftJoin,where)
|
||||
reData := that.Db.Page(page, pageSize).
|
||||
PageSelect(that.RouterString[1], columnStr, where)
|
||||
PageSelect(that.RouterString[1],leftJoin,columnStr, where)
|
||||
|
||||
|
||||
for _, v := range reData {
|
||||
|
||||
Reference in New Issue
Block a user