作者 Administrator

合并分支 'test' 到 'master'

Test



查看合并请求 !5
... ... @@ -136,6 +136,8 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction.
default:
tx = tx.Order("created_at desc")
}
} else {
tx = tx.Order("created_at desc")
}
if v, ok := queryOptions["ids"]; ok {
tx = tx.Where("id in (?)", v)
... ...
... ... @@ -102,7 +102,6 @@ func (m *Article) SetSummary(sectionList []*ArticleSection) {
//设置内容概要
// 截取内容 50个字
runeNumber := 0 //字数
stringIndex := 0 //字符串长度
content := ""
for i := range sectionList {
... ... @@ -112,12 +111,9 @@ func (m *Article) SetSummary(sectionList []*ArticleSection) {
break
}
}
for i := range content {
if runeNumber > 50 {
break
}
runeNumber += 1
stringIndex = i
stringIndex = len(content)
if len(content) > 50 {
stringIndex = 50
}
m.Summary = content[0:stringIndex]
}
... ...