lejianwen месяцев назад: 10
Родитель
Сommit
746e2a6052
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      service/peer.go

+ 8 - 1
service/peer.go

@@ -126,7 +126,14 @@ func (ps *PeerService) GetUuidListByIDs(ids []uint) ([]string, error) {
126 126
 	err := DB.Model(&model.Peer{}).
127 127
 		Where("row_id in (?)", ids).
128 128
 		Pluck("uuid", &uuids).Error
129
-	return uuids, err
129
+	//过滤uuids中的空字符串
130
+	var newUuids []string
131
+	for _, uuid := range uuids {
132
+		if uuid != "" {
133
+			newUuids = append(newUuids, uuid)
134
+		}
135
+	}
136
+	return newUuids, err
130 137
 }
131 138
 
132 139
 // BatchDelete 批量删除, 同时也应该删除token