A reward system in which openid and ID (1-999999) users click on the payment notify to get out_trade_no,
I want to write information about who rewards whom to the database, then openid (28 bits) + random 4 bits take up exactly 32 bits. However, random 4-bit strings can easily cause repetition of the order number, so years, months, days, plus strings are usually used, but if ID is used, once the ID changes, or due to other reasons, the payment data will not correspond.
another way is to insert all the required information to the database when generating payment information, and then update this record when it is successfully notified, but this results in a waste of server resources.
there is another way to use ID (6) + the other party"s openid.substring (0Jing 14) + year, month and day (180910) + random (6)
6 "14" 6 "6" 32, but if there is a lot of payment information in a day, there may still be duplication.
what do you experts usually do? The participants themselves would like to give a small reward. :)