|
@@ -158,7 +158,7 @@ func UpdateReportEs(reportId int, publishState int) (err error) {
|
|
|
if len(chapterList) > 0 {
|
|
|
// 更新章节的es数据
|
|
|
for _, chapterInfo := range chapterList {
|
|
|
- err = updateReportChapterEsByChapter(chapterInfo)
|
|
|
+ err = updateReportChapterEsByChapter(chapterInfo, reportInfo.IsPublicPublish)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -257,7 +257,7 @@ func addCategoryAliasToArr(categoryArr []string) (aliasArr []string, err error)
|
|
|
// @datetime 2024-06-20 13:16:22
|
|
|
// @param reportChapterId int
|
|
|
// @return err error
|
|
|
-func UpdateReportChapterEs(reportChapterId int) (err error) {
|
|
|
+func UpdateReportChapterEs(reportChapterId int, isPublicPublish int8) (err error) {
|
|
|
if reportChapterId <= 0 {
|
|
|
return
|
|
|
}
|
|
@@ -266,7 +266,7 @@ func UpdateReportChapterEs(reportChapterId int) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- err = updateReportChapterEsByChapter(chapterInfo)
|
|
|
+ err = updateReportChapterEsByChapter(chapterInfo, isPublicPublish)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -280,7 +280,7 @@ func UpdateReportChapterEs(reportChapterId int) (err error) {
|
|
|
// @datetime 2024-06-20 13:16:11
|
|
|
// @param chapterInfo *models.ReportChapter
|
|
|
// @return err error
|
|
|
-func updateReportChapterEsByChapter(chapterInfo *models.ReportChapter) (err error) {
|
|
|
+func updateReportChapterEsByChapter(chapterInfo *models.ReportChapter, isPublicPublish int8) (err error) {
|
|
|
// 章节对应的品种
|
|
|
obj := report.ReportChapterPermissionMapping{}
|
|
|
permissionList, tmpErr := obj.GetPermissionItemListById(chapterInfo.ReportChapterId)
|
|
@@ -305,6 +305,7 @@ func updateReportChapterEsByChapter(chapterInfo *models.ReportChapter) (err erro
|
|
|
BodyContent: utils.TrimHtml(html.UnescapeString(chapterInfo.Content)),
|
|
|
PublishTime: chapterInfo.PublishTime.Format(utils.FormatDateTime),
|
|
|
PublishState: chapterInfo.PublishState,
|
|
|
+ IsPublicPublish: isPublicPublish,
|
|
|
Author: chapterInfo.Author,
|
|
|
ClassifyIdFirst: chapterInfo.ClassifyIdFirst,
|
|
|
ClassifyNameFirst: chapterInfo.ClassifyNameFirst,
|