Kaynağa Gözat

分类名称关键词一起搜索处理

WH01243 2 yıl önce
ebeveyn
işleme
a5e548bc74

+ 4 - 3
jyBXSubscribe/api/internal/logic/byPushHistoryLogic.go

@@ -46,11 +46,12 @@ func (l *ByPushHistoryLogic) ByPushHistory(req *types.SubscribeReq) (resp *types
 				}
 			}
 		}
-		if len(matchitemsArr) == 0 {
-			matchkeys = strings.Join(matchkeysArr, ",")
-		} else {
+		if len(matchitemsArr) != 0 {
 			matchitems = strings.Join(matchitemsArr, ",")
 		}
+		if len(matchkeysArr) != 0 {
+			matchkeys = strings.Join(matchkeysArr, ",")
+		}
 	} else {
 		matchkeys = req.KeyWords
 	}

+ 4 - 3
jyBXSubscribe/api/internal/logic/subscribeListLogic.go

@@ -48,11 +48,12 @@ func (l *SubscribeListLogic) SubscribeList(req *types.SubscribeReq) (resp *types
 				}
 			}
 		}
-		if len(matchitemsArr) == 0 {
-			matchkeys = strings.Join(matchkeysArr, ",")
-		} else {
+		if len(matchitemsArr) != 0 {
 			matchitems = strings.Join(matchitemsArr, ",")
 		}
+		if len(matchkeysArr) != 0 {
+			matchkeys = strings.Join(matchkeysArr, ",")
+		}
 	} else {
 		matchkeys = req.KeyWords
 	}