文章列表只显示前50个字节的内容

master
a74589669 2019-10-06 19:21:25 +08:00
parent b3e9b1d9a1
commit dab24f3f84
1 changed files with 1 additions and 1 deletions

View File

@ -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{