#1837 解决 #1808 及#1807 两个问题。

Merged
lewis merged 4 commits from zouap into V20220415 2 years ago
  1. +1
    -0
      models/dbsql/issue_foreigntable_for_es.sql
  2. +8
    -4
      routers/search.go

+ 1
- 0
models/dbsql/issue_foreigntable_for_es.sql View File

@@ -193,6 +193,7 @@ $def$
name=NEW.name,
is_closed=NEW.is_closed,
num_comments=NEW.num_comments,
updated_unix=NEW.updated_unix,
comment=(select array_to_string(array_agg(content order by created_unix desc),',') from public.comment where issue_id=NEW.id)
where id=NEW.id;
return new;


+ 8
- 4
routers/search.go View File

@@ -573,7 +573,8 @@ func trimFontHtml(text []rune) string {
startRune := rune('<')
endRune := rune('>')
count := 0
for i := 0; i < len(text); i++ {
i := 0
for ; i < len(text); i++ {
if text[i] == startRune { //start <
re := false
j := i + 1
@@ -592,11 +593,14 @@ func trimFontHtml(text []rune) string {
} else {
return string(text[0:i])
}

}
}
}
return string(text)
if count%2 == 1 {
return string(text[0:i]) + "</font>"
} else {
return string(text[0:i])
}
}

func trimHrefHtml(result string) string {
@@ -1125,7 +1129,7 @@ func makePrivateIssueOrPr(issues []*models.Issue, res *SearchRes, Key string, la
record["num_comments"] = issue.NumComments
record["is_closed"] = issue.IsClosed
record["updated_unix"] = issue.UpdatedUnix
record["updated_html"] = timeutil.TimeSinceUnix(repo.UpdatedUnix, language)
record["updated_html"] = timeutil.TimeSinceUnix(issue.UpdatedUnix, language)
res.Result = append(res.Result, record)
}
}


Loading…
Cancel
Save