Kaynağa Gözat

wip:订阅判重

wangshan 4 ay önce
ebeveyn
işleme
285cd5139f

+ 5 - 1
jyBXSubscribe/api/internal/logic/subscribeupdatelogic.go

@@ -109,8 +109,12 @@ func KeyWordsRepeat(aitems []map[string]interface{}) bool {
 					}
 					if n["matchway"] != nil {
 						matchway = common.IntAll(n["matchway"])
+						if mn, ok := n["matchway"].(json.Number); matchway == 0 && ok {
+							mi, _ := mn.Int64()
+							matchway = int(mi)
+						}
 					}
-					key := fmt.Sprintf("%v%v%v%s", db_key, db_append, db_not, matchway)
+					key := fmt.Sprintf("%v%v%v%d", db_key, db_append, db_not, matchway)
 					if m[key] {
 						return true //有重复 不可以提交
 					}