diff --git a/controller/blog.go b/controller/blog.go index d53394b..c50b4d0 100644 --- a/controller/blog.go +++ b/controller/blog.go @@ -44,7 +44,7 @@ func GetArticles(c *gin.Context) { if req.Name != ""{ sql = fmt.Sprintf("select * from doc where doc.name like '%%%s%%' limit %d offset %d",req.Name,limit,offset*limit) }else{ - sql = fmt.Sprintf("select * from doc limit %d offset %d",limit,offset) + sql = fmt.Sprintf("SELECT doc.id,doc.author,LEFT(doc.content,50) as content,doc.title,doc.type from doc limit %d offset %d",limit,offset) } e = db.GetMysqlClient().Query2(sql,&article) if nil != e{