修复bug
This commit is contained in:
parent
d1a8f6c668
commit
deb3e54cc3
@ -9,22 +9,22 @@ var categoryCtr = Ctr{
|
|||||||
"info": func(that *Context) {
|
"info": func(that *Context) {
|
||||||
parentId := ObjToInt(that.Req.FormValue("id"))
|
parentId := ObjToInt(that.Req.FormValue("id"))
|
||||||
//parentId := ObjToInt(that.RouterString[2])
|
//parentId := ObjToInt(that.RouterString[2])
|
||||||
childData:=[]Map{}
|
childData := []Map{}
|
||||||
if parentId == 0 {
|
if parentId == 0 {
|
||||||
childData1 := that.Db.Select("category", "*", Map{"parent_id": nil})
|
childData1 := that.Db.Select("category", "*", Map{"parent_id": nil})
|
||||||
|
|
||||||
for _, v := range childData1 {
|
for _, v := range childData1 {
|
||||||
data := that.Db.Get("category", "*", Map{"parent_id": v.GetCeilInt("id")})
|
data := that.Db.Get("category", "*", Map{"parent_id": v.GetCeilInt("id")})
|
||||||
childData=append(childData,data)
|
if data != nil {
|
||||||
|
childData = append(childData, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
childData = that.Db.Select("category", "*", Map{"parent_id": parentId})
|
childData = that.Db.Select("category", "*", Map{"parent_id": parentId})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for _, v := range childData {
|
for _, v := range childData {
|
||||||
v["child"] = that.Db.Select("category", "*", Map{"parent_id": v.GetCeilInt("id")})
|
v["child"] = that.Db.Select("category", "*", Map{"parent_id": v.GetCeilInt("id")})
|
||||||
}
|
}
|
||||||
|
BIN
example/bzyy.exe
BIN
example/bzyy.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user