|
@@ -159,7 +159,20 @@ func (d *DataExport) SieveData() {
|
|
|
winnerArr = strings.Split(winner, ",")
|
|
|
log.Println("winnerArr", winnerArr)
|
|
|
}
|
|
|
- selectType = strings.Replace(selectType, "title,title", "title", -1)
|
|
|
+ if selectType != "" {
|
|
|
+ //去重 如果选取了标题及正文 引起的有2个title问题
|
|
|
+ if strings.Count(selectType, "title") > 1 {
|
|
|
+ var detail []string
|
|
|
+ for _, v := range strings.Split(selectType, ",") {
|
|
|
+ if v == "title" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ detail = append(detail, v)
|
|
|
+ }
|
|
|
+ //维持原逻辑 正文表示标题及正文
|
|
|
+ selectType = strings.Replace(strings.Join(detail, ","), "detail", "title,detail", -1)
|
|
|
+ }
|
|
|
+ }
|
|
|
sieveCondition := map[string]interface{}{
|
|
|
"publishtime": publishtime,
|
|
|
"area": areaArr,
|