2021-08-28 05:06:00 +00:00
|
|
|
package app
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "../../../hotime"
|
|
|
|
. "../../../hotime/common"
|
|
|
|
)
|
|
|
|
|
|
|
|
var categoryCtr = Ctr{
|
|
|
|
"info": func(that *Context) {
|
2021-08-28 22:08:19 +00:00
|
|
|
parentId := ObjToInt(that.Req.FormValue("id"))
|
|
|
|
//parentId := ObjToInt(that.RouterString[2])
|
2021-08-28 05:06:00 +00:00
|
|
|
if parentId == 0 {
|
|
|
|
parentId = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
childData := that.Db.Select("category", "*", Map{"parent_id": parentId})
|
|
|
|
|
|
|
|
for _, v := range childData {
|
|
|
|
v["child"] = that.Db.Select("category", "*", Map{"parent_id": v.GetCeilInt("id")})
|
|
|
|
}
|
|
|
|
|
|
|
|
that.Display(0, childData)
|
|
|
|
},
|
|
|
|
}
|