文章 分頁 bug修改
parent
6109f974a6
commit
e516b374af
|
@ -44,7 +44,7 @@ func GetArticles(c *gin.Context) {
|
||||||
if req.Name != ""{
|
if req.Name != ""{
|
||||||
sql = fmt.Sprintf("select * from doc where doc.name like '%%%s%%' limit %d offset %d",req.Name,limit,offset*limit)
|
sql = fmt.Sprintf("select * from doc where doc.name like '%%%s%%' limit %d offset %d",req.Name,limit,offset*limit)
|
||||||
}else{
|
}else{
|
||||||
sql = fmt.Sprintf("select * from doc limit %d offset %d",limit,offset*limit)
|
sql = fmt.Sprintf("select * from doc limit %d offset %d",limit,offset)
|
||||||
}
|
}
|
||||||
e = db.GetMysqlClient().Query2(sql,&article)
|
e = db.GetMysqlClient().Query2(sql,&article)
|
||||||
if nil != e{
|
if nil != e{
|
||||||
|
|
Loading…
Reference in New Issue