Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
This commit is contained in:
@@ -1010,11 +1010,13 @@ export class GirlData extends BaseData {
|
||||
/** 获取所有可聊天的技师 id */
|
||||
public getAllCanChatGirlIds(): 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.isCanChat(categoryId, girlId)) {
|
||||
if (this.isCanChat(categoryId, girlId) && !seen.has(girlId)) {
|
||||
seen.add(girlId); // 标记已加入
|
||||
result.push(girlId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user