wangchuanjin 2 роки тому
батько
коміт
c801eb2c10
2 змінених файлів з 11 додано та 0 видалено
  1. 9 0
      matcher/paymatch.go
  2. 2 0
      p/struct.go

+ 9 - 0
matcher/paymatch.go

@@ -129,11 +129,20 @@ func (p *PayUser) GetFinalUser(matchWay string, keys, notkeys []string, key_user
 			if matchUser == nil {
 				matchUser = &MatchUser{
 					Keys:      []string{},
+					Items:     []string{},
+					Item:      map[string]bool{},
 					MatchWays: []string{},
 					MatchWay:  map[string]bool{},
 				}
 			}
 			matchUser.Keys = append(matchUser.Keys, k)
+			item := u.SubSet.Key_item[k]
+			if item != "" {
+				if !matchUser.Item[item] {
+					matchUser.Items = append(matchUser.Items, item)
+				}
+				matchUser.Item[item] = true
+			}
 			if !matchUser.MatchWay[matchWay] {
 				matchUser.MatchWays = append(matchUser.MatchWays, matchWay)
 			}

+ 2 - 0
p/struct.go

@@ -694,6 +694,8 @@ func (p *KeyDfa) CreateDaf() {
 
 type MatchUser struct {
 	Keys      []string
+	Items     []string
+	Item      map[string]bool
 	MatchWays []string
 	MatchWay  map[string]bool
 }