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