获取所有解锁技师,去重

This commit is contained in:
chen wei bo
2025-09-23 10:29:13 +08:00
parent aab4ccd8b7
commit bc8fc78306
+4 -2
View File
@@ -835,11 +835,13 @@ export class GirlData extends BaseData {
/** 获取所有已经解锁技师的 id,不区分技师的付费类型 */
public getAllReleaseGirlIds(): number[] {
const result: number[] = [];
const seen = new Set<number>(); // 用来去重
const cats = this.ensureCategories();
// 遍历
for (const [categoryId, bucket] of cats.entries()) {
for (const girlId of bucket.girlIds) {
if (this.getIsRelease(categoryId, girlId)) {
if (this.getIsRelease(categoryId, girlId) && !seen.has(girlId)) {
seen.add(girlId); // 标记已加入
result.push(girlId);
}
}