Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重复中奖 #50

Open
ethdeve opened this issue Nov 27, 2023 · 6 comments
Open

重复中奖 #50

ethdeve opened this issue Nov 27, 2023 · 6 comments

Comments

@ethdeve
Copy link

ethdeve commented Nov 27, 2023

已经中奖名单,没有在抽奖池移除,出现一个人重复中奖

@Kiteflyingee
Copy link

我试了好多次,出现了这种情况

@mym0562
Copy link

mym0562 commented Jan 17, 2024

这个问题有办法解决吗

@Kuro-QAQ
Copy link

+1,我应该如何修改呢

@geekftz
Copy link

geekftz commented Jan 18, 2024

应该没有这个问题吧,同时只能有一个人在抽

@Kuro-QAQ
Copy link

似乎是因为点击重新抽奖时,没有将这次抽到的人放回奖池。我通过每次lottery时观察basicData.leftUsers.length的长度,每次点击重新抽奖时,这个长度也会减少本轮抽奖数量,因为我设置的奖项和人员数量是相等的,最终就会导致抽取次数大于人员数,从而开启新的一轮人员池,导致重复。

@Kuro-QAQ
Copy link

似乎是因为点击重新抽奖时,没有将这次抽到的人放回奖池。我通过每次lottery时观察basicData.leftUsers.length的长度,每次点击重新抽奖时,这个长度也会减少本轮抽奖数量,因为我设置的奖项和人员数量是相等的,最终就会导致抽取次数大于人员数,从而开启新的一轮人员池,导致重复。

https://github.com/Kuro-QAQ/lottery
针对我描述的情况,做了一些修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants