mirror of https://github.com/mindoc-org/mindoc.git
优化代码
parent
cc32b6e8a7
commit
969fd44b9c
|
@ -79,7 +79,7 @@ func (c *BlogController) List() {
|
|||
blogList,totalCount,err = models.NewBlog().FindToPager(pageIndex,conf.PageSize,0,"")
|
||||
|
||||
|
||||
if err != nil {
|
||||
if err != nil && err != orm.ErrNoRows {
|
||||
c.ShowErrorPage(500,err.Error())
|
||||
}
|
||||
if totalCount > 0 {
|
||||
|
|
|
@ -219,9 +219,6 @@ func (b *Blog) FindToPager(pageIndex, pageSize int,memberId int,status string) (
|
|||
_,err = query.OrderBy("-order_index","-blog_id").Offset(offset).Limit(pageSize).All(&blogList)
|
||||
|
||||
if err != nil {
|
||||
if err == orm.ErrNoRows {
|
||||
return
|
||||
}
|
||||
beego.Error("获取文章列表时出错 ->",err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue