修复小bug

master
a7458969 2020-05-04 16:12:17 +08:00
parent 3e61016a3e
commit 302f63dcfe
1 changed files with 3 additions and 3 deletions

View File

@ -82,11 +82,11 @@ func GetArticles(c *gin.Context) {
}else{ }else{
is_public = 1 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" + 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) "limit %d offset %d",req.Type,is_public,limit,offset)
} }
} }
log.Print(sql)
e = db.GetMysqlClient().Query2(sql,&article) e = db.GetMysqlClient().Query2(sql,&article)
if nil != e{ if nil != e{
logs.Error(e.Error(),sql) logs.Error(e.Error(),sql)