测试
This commit is contained in:
+12
-2
@@ -9,11 +9,21 @@ var categoryCtr = Ctr{
|
||||
"info": func(that *Context) {
|
||||
parentId := ObjToInt(that.Req.FormValue("id"))
|
||||
//parentId := ObjToInt(that.RouterString[2])
|
||||
childData:=[]Map{}
|
||||
if parentId == 0 {
|
||||
parentId = 1
|
||||
childData1 := that.Db.Select("category", "*", Map{"parent_id": nil})
|
||||
|
||||
for _, v := range childData1 {
|
||||
data := that.Db.Get("category", "*", Map{"parent_id": v.GetCeilInt("id")})
|
||||
childData=append(childData,data)
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
childData = that.Db.Select("category", "*", Map{"parent_id": parentId})
|
||||
}
|
||||
|
||||
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")})
|
||||
|
||||
Reference in New Issue
Block a user