文章列表只显示前50个字节的内容
parent
b3e9b1d9a1
commit
dab24f3f84
|
@ -44,7 +44,7 @@ func GetArticles(c *gin.Context) {
|
||||||
if req.Name != ""{
|
if req.Name != ""{
|
||||||
sql = fmt.Sprintf("select * from doc where doc.name like '%%%s%%' limit %d offset %d",req.Name,limit,offset*limit)
|
sql = fmt.Sprintf("select * from doc where doc.name like '%%%s%%' limit %d offset %d",req.Name,limit,offset*limit)
|
||||||
}else{
|
}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)
|
e = db.GetMysqlClient().Query2(sql,&article)
|
||||||
if nil != e{
|
if nil != e{
|
||||||
|
|
Loading…
Reference in New Issue