From 302f63dcfef1931c9193de6ddd8e16d5ebddeca5 Mon Sep 17 00:00:00 2001 From: a7458969 <290198252@qq.com> Date: Mon, 4 May 2020 16:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/blog.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)