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