**apifm lottery module expired lottery type lottery why you need to fill in the 5-digit lottery number**
The lottery module of apifm supports two lottery modes:
**Real-time lottery draw**
When adding lottery settings in the background, set the probability of winning. Users can participate in the draw immediately, and users can immediately know whether they have won.
The probability of winning determines how difficult it is to win
**Lottery due**
In this lottery mode, only one user can draw the lottery after the lottery is drawn.
When adding lottery settings in the background, set the lottery time. All users will get a lottery number after participating in the lottery. No one will know who won the prize until the lottery time arrives.
The backend cannot specify which user wins the prize. This is to ensure the objectivity and fairness of the lottery.
Let’s talk about the lottery drawing process in the **Expired Lottery** mode in detail:
1. Users can get a unique lottery number after participating. Once the lottery number is generated, it will not change;
_Similar to the lottery numbers you buy, they cannot change after the ticket is issued_
2. After the lottery drawing time is up, the lottery will be drawn the day after tomorrow. Fill in the lottery number of the current national lottery-Chongqing Lottery. The number is objective and fair, and the background cannot cheat;
_This number is officially announced by the lottery. All users know and recognize this 5-digit lottery number_
3. The system uses the following algorithm to determine which user with the lottery number wins:
Assumptions:
The winning announcement number of Chongqing Shishi Lottery (5 digits) = X
Number of participants (total number of lottery numbers) = Y
Then the winning number is:
Remainder obtained by X ➗ Y + 1