Update 13.5.md

func GetBlog(id int) (blog Blog) {
    db := GetLink()
    db.Where("id=?", id).Find(&blogs)
    return
}

models/cart.go:34: undefined: blogs
This commit is contained in:
picker
2013-05-06 15:04:26 +08:00
parent 9885ed185f
commit 79c30d791e

View File

@@ -167,7 +167,7 @@ DeleteController
func GetBlog(id int) (blog Blog) {
db := GetLink()
db.Where("id=?", id).Find(&blogs)
db.Where("id=?", id).Find(&blog)
return
}
@@ -256,4 +256,4 @@ edit.tpl
## links
* [目录](<preface.md>)
* 上一章: [数据库操作](<13.4.md>)
* 下一节: [小结](<13.6.md>)
* 下一节: [小结](<13.6.md>)