diff --git a/controller/blog.go b/controller/blog.go index 1751b3d..88d4d3b 100644 --- a/controller/blog.go +++ b/controller/blog.go @@ -82,11 +82,11 @@ func GetArticles(c *gin.Context) { }else{ is_public = 1 } - sql = fmt.Sprintf("SELECT doc.id,doc.author,LEFT(doc.content,50) as content,doc.title,doc.type from doc where doc.type = %d and is_public = %d" + - "limit %d offset %d",is_public,req.Type,limit,offset) - + sql = fmt.Sprintf("SELECT doc.id,doc.author,LEFT(doc.content,50) as content,doc.title,doc.type from doc where doc.type = %d and is_public = %d " + + "limit %d offset %d",req.Type,is_public,limit,offset) } } + log.Print(sql) e = db.GetMysqlClient().Query2(sql,&article) if nil != e{ logs.Error(e.Error(),sql)