作者 yangfu
... ... @@ -123,15 +123,11 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR
//切分文章分段
sectionList := []domain.ArticleSection{}
newStr := ""
for i := range req.Section {
strList := strings.Split(req.Section[i], "\n")
for i2 := range strList {
newStr := strings.TrimSpace(strList[i2])
if len(newStr) == 0 {
continue
}
newStr = template.HTMLEscapeString(newStr)
newStr = template.HTMLEscapeString(strList[i2])
newSection := domain.ArticleSection{
Id: 0,
CompanyId: author.CompanyId,
... ...
... ... @@ -121,13 +121,13 @@ func (repository *MessageSystemRepository) Find(ctx context.Context, conn transa
)
queryFunc := func() (interface{}, error) {
tx = tx.Model(&ms).Order("id desc")
if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
if v, ok := queryOptions["companyId"]; ok {
tx.Where("company_id = ?", v)
}
if v, ok := queryOptions["recipientId"]; ok {
tx.Where("recipient_id = ?", v)
}
if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
return dms, tx.Error
}
return dms, nil
... ...